diff options
author | Devaev Maxim <[email protected]> | 2020-11-14 18:18:53 +0300 |
---|---|---|
committer | Devaev Maxim <[email protected]> | 2020-11-14 18:18:53 +0300 |
commit | a9c844acb467089112f64f01923b9618277f8616 (patch) | |
tree | 2f851178505d3ec8dbb10f22fabf5e19744a35ff /hid/src/usb/hid.h | |
parent | 58f60bb49f582fba5ac0810c07642e9313b33bfb (diff) |
refactoring
Diffstat (limited to 'hid/src/usb/hid.h')
-rw-r--r-- | hid/src/usb/hid.h | 18 |
1 files changed, 9 insertions, 9 deletions
diff --git a/hid/src/usb/hid.h b/hid/src/usb/hid.h index 6b729323..326e8cc5 100644 --- a/hid/src/usb/hid.h +++ b/hid/src/usb/hid.h @@ -71,31 +71,31 @@ class UsbHidMouse { SingleAbsoluteMouse.releaseAll(); } - void sendMouseButtons( + void sendButtons( bool left_select, bool left_state, bool right_select, bool right_state, bool middle_select, bool middle_state, bool up_select, bool up_state, bool down_select, bool down_state ) { - if (left_select) _sendMouseButton(MOUSE_LEFT, left_state); - if (right_select) _sendMouseButton(MOUSE_RIGHT, right_state); - if (middle_select) _sendMouseButton(MOUSE_MIDDLE, middle_state); - if (up_select) _sendMouseButton(MOUSE_PREV, up_state); - if (down_select) _sendMouseButton(MOUSE_NEXT, down_state); + if (left_select) _sendButton(MOUSE_LEFT, left_state); + if (right_select) _sendButton(MOUSE_RIGHT, right_state); + if (middle_select) _sendButton(MOUSE_MIDDLE, middle_state); + if (up_select) _sendButton(MOUSE_PREV, up_state); + if (down_select) _sendButton(MOUSE_NEXT, down_state); } - void sendMouseMove(int x, int y) { + void sendMove(int x, int y) { SingleAbsoluteMouse.moveTo(x, y); } - void sendMouseWheel(int delta_y) { + void sendWheel(int delta_y) { // delta_x is not supported by hid-project now SingleAbsoluteMouse.move(0, 0, delta_y); } private: - void _sendMouseButton(uint8_t button, bool state) { + void _sendButton(uint8_t button, bool state) { if (state) SingleAbsoluteMouse.press(button); else SingleAbsoluteMouse.release(button); } |