diff options
author | Devaev Maxim <[email protected]> | 2018-08-31 00:25:13 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2018-08-31 00:25:13 +0300 |
commit | 1bf3506d2e72eba65d8c7d187151a51cf0abcf6d (patch) | |
tree | 1ca076477c31a452b9f48148adc4f30bab66f712 | |
parent | bc24d2c19327db81e0c3f491135e2c7c1a5dd098 (diff) |
using SingleAbsoluteMouse()
-rw-r--r-- | hid/src/main.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/hid/src/main.cpp b/hid/src/main.cpp index 31b45515..7bfced13 100644 --- a/hid/src/main.cpp +++ b/hid/src/main.cpp @@ -20,7 +20,7 @@ INLINE void cmdResetHid() { // 0 bytes CMD_SERIAL.read(); // unused CMD_SERIAL.read(); // unused BootKeyboard.releaseAll(); - AbsoluteMouse.releaseAll(); + SingleAbsoluteMouse.releaseAll(); } INLINE void cmdKeyEvent() { // 2 bytes @@ -42,7 +42,7 @@ INLINE void cmdMouseMoveEvent() { // 4 bytes x |= (int)CMD_SERIAL.read(); int y = (int)CMD_SERIAL.read() << 8; y |= (int)CMD_SERIAL.read(); - AbsoluteMouse.moveTo(x, y); + SingleAbsoluteMouse.moveTo(x, y); } INLINE void cmdMouseButtonEvent() { // 1 byte @@ -52,16 +52,16 @@ INLINE void cmdMouseButtonEvent() { // 1 byte CMD_SERIAL.read(); // unused if (state & CMD_MOUSE_LEFT) { if (state & CMD_MOUSE_LEFT_STATE) { - AbsoluteMouse.press(MOUSE_LEFT); + SingleAbsoluteMouse.press(MOUSE_LEFT); } else { - AbsoluteMouse.release(MOUSE_LEFT); + SingleAbsoluteMouse.release(MOUSE_LEFT); } } if (state & CMD_MOUSE_RIGHT) { if (state & CMD_MOUSE_RIGHT_STATE) { - AbsoluteMouse.press(MOUSE_RIGHT); + SingleAbsoluteMouse.press(MOUSE_RIGHT); } else { - AbsoluteMouse.release(MOUSE_RIGHT); + SingleAbsoluteMouse.release(MOUSE_RIGHT); } } } @@ -71,7 +71,7 @@ INLINE void cmdMouseWheelEvent() { // 2 bytes signed char delta_y = CMD_SERIAL.read(); CMD_SERIAL.read(); // unused CMD_SERIAL.read(); // unused - AbsoluteMouse.move(0, 0, delta_y); + SingleAbsoluteMouse.move(0, 0, delta_y); } @@ -79,7 +79,7 @@ INLINE void cmdMouseWheelEvent() { // 2 bytes void setup() { CMD_SERIAL.begin(CMD_SERIAL_SPEED); BootKeyboard.begin(); - AbsoluteMouse.begin(); + SingleAbsoluteMouse.begin(); CMD_SERIAL.write(0); } |