From db13ba9c3473ccf5bb72c4ee0f698afff37891ed Mon Sep 17 00:00:00 2001 From: Fierelier Date: Sat, 13 Jul 2024 06:55:44 +0200 Subject: [PATCH] Add docs --- README.txt | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) create mode 100644 README.txt diff --git a/README.txt b/README.txt new file mode 100644 index 0000000..5de01dc --- /dev/null +++ b/README.txt @@ -0,0 +1,23 @@ +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 + +KEYBOARD (1): +* uint8 pressed: If the button is pressed (1) or released (0) +* uint8 keycode: The keycode of the button + +MOUSE_MOVE (2): +* int32 x: Relative X movement (negative numbers move to the left) +* int32 y: Relative Y movement (negative numbers move to the top) + +MOUSE_PRESS (3): +* uint8 pressed: If the button is pressed (1) or released (0) +* uint8 keycode: The keycode of the button + +MOUSE_WHEEL (4): +* int32 x: Wheel X roll (negative numbers move to the left) +* int32 y: Wheel Y roll (negative numbers move to the top)