arduino hid: fixed mouse movement on windows

This commit is contained in:
Devaev Maxim
2019-10-05 02:42:06 +03:00
parent f5bbfeb8b5
commit da660d02cd
5 changed files with 35 additions and 1 deletions

View File

@@ -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);
}