2024-07-13 04:55:44 +00:00
|
|
|
The protocol is little endian.
|
|
|
|
|
|
|
|
Each event is prefixed by 9 null bytes, and an event type, which is 1 byte.
|
|
|
|
|
|
|
|
A key-press event would look like this:
|
|
|
|
0 0 0 0 0 0 0 0 0 1 5
|
|
|
|
* 9 padding nulls, 1 = event id (keyboard), 5 = button
|
|
|
|
|
2024-07-13 06:55:26 +00:00
|
|
|
HEARTBEAT (1):
|
|
|
|
* no data
|
|
|
|
|
|
|
|
KEYBOARD (2):
|
2024-07-13 04:55:44 +00:00
|
|
|
* uint8 pressed: If the button is pressed (1) or released (0)
|
|
|
|
* uint8 keycode: The keycode of the button
|
|
|
|
|
2024-07-13 06:55:26 +00:00
|
|
|
MOUSE_MOVE (3):
|
2024-07-13 04:55:44 +00:00
|
|
|
* int32 x: Relative X movement (negative numbers move to the left)
|
|
|
|
* int32 y: Relative Y movement (negative numbers move to the top)
|
|
|
|
|
2024-07-13 06:55:26 +00:00
|
|
|
MOUSE_PRESS (4):
|
2024-07-13 04:55:44 +00:00
|
|
|
* uint8 pressed: If the button is pressed (1) or released (0)
|
|
|
|
* uint8 keycode: The keycode of the button
|
|
|
|
|
2024-07-13 06:55:26 +00:00
|
|
|
MOUSE_WHEEL (5):
|
2024-07-13 04:55:44 +00:00
|
|
|
* int32 x: Wheel X roll (negative numbers move to the left)
|
|
|
|
* int32 y: Wheel Y roll (negative numbers move to the top)
|