diff options
author | Devaev Maxim <[email protected]> | 2019-10-05 02:42:06 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2019-10-05 02:42:06 +0300 |
commit | da660d02cd9184f31f47bec3edb3a600608b45d5 (patch) | |
tree | e079c5a144259a04ac7ea53aaf69861c640bbf6c /hid/src/main.cpp | |
parent | f5bbfeb8b523ddb9fe1277f2b06deb3970e51105 (diff) |
arduino hid: fixed mouse movement on windows
Diffstat (limited to 'hid/src/main.cpp')
-rw-r--r-- | hid/src/main.cpp | 2 |
1 files changed, 2 insertions, 0 deletions
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); } |