From da660d02cd9184f31f47bec3edb3a600608b45d5 Mon Sep 17 00:00:00 2001 From: Devaev Maxim Date: Sat, 5 Oct 2019 02:42:06 +0300 Subject: arduino hid: fixed mouse movement on windows --- hid/src/main.cpp | 2 ++ 1 file changed, 2 insertions(+) (limited to 'hid/src/main.cpp') diff --git a/hid/src/main.cpp b/hid/src/main.cpp index 27520f97..fe5e0210 100644 --- a/hid/src/main.cpp +++ b/hid/src/main.cpp @@ -98,9 +98,11 @@ INLINE void cmdMouseButtonEvent(const uint8_t *buffer) { // 1 byte INLINE void cmdMouseMoveEvent(const uint8_t *buffer) { // 4 bytes int x = (int)buffer[0] << 8; x |= (int)buffer[1]; + x = (x + 32768) / 2; // See /kvmd/apps/otg/hid/keyboard.py for details int y = (int)buffer[2] << 8; y |= (int)buffer[3]; + y = (y + 32768) / 2; // See /kvmd/apps/otg/hid/keyboard.py for details SingleAbsoluteMouse.moveTo(x, y); } -- cgit v1.2.3