linux-uhid
- NodeJS bindings for Linux's UHID interfacelinux-uhid
is a NodeJS module that provides bindings for Linux's UHID interface. It allows you to create virtual HID devices and send input reports to them.
NOTE: Module has to be used with elevated privileges (root)!
You can install linux-uhid
via npm:
npm install linux-uhid
const uhid = require('linux-uhid');
var device = new UHIDDevice();
device.open();
device.create( {
name: "node-uhid-device",
data: Buffer.from( hid_descriptor ),
bus: UHIDBusType.USB,
vendor: 0x15d9,
product: 0x0a37,
version: 0x0001,
country: 0x00
} );
// Send input report
device.input( Buffer.from( hid_input_report ));
Look at test.ts
for an example of a mouse.
Generated using TypeDoc