delay
Add a delay to command processingField | Type | Description |
---|---|---|
id | integer | Device id |
command | string | Must be set to “delay” |
duration | integer | Delay in milliseconds |
Example:
{ "id": 1, "command": "delay", "duration": 10 }
inject
Send an array of uinput event packets [type, code, value] to the uinput deviceField | Type | Description |
---|---|---|
id | integer | Device id |
command | string | Must be set to “inject” |
events | integer array | events to inject |
The “events” parameter is an array of integers, encapsulates evdev input_event type, code and value, see the example below.
Example:
{ "id": 1, "command": "inject", "events": [0x01, 0xb, 0x1, // EV_KEY, KEY_0, DOWN 0x00, 0x00, 0x00, // EV_SYN, SYN_REPORT, 0 0x01, 0x0b, 0x00, // EV_KEY, KEY_0, UP 0x00, 0x00, 0x00, // EV_SYN, SYN_REPORT, 0 0x01, 0x2, 0x1, // EV_KEY, KEY_1, DOWN 0x00, 0x00, 0x01, // EV_SYN, SYN_REPORT, 0 0x01, 0x02, 0x00, // EV_KEY, KEY_1, UP 0x00, 0x00, 0x01 // EV_SYN, SYN_REPORT, 0 ] }
getevent
utility can used to print out the key events for debugging purposes.