diff options
| author | hathach <[email protected]> | 2018-07-24 20:51:50 +0700 |
|---|---|---|
| committer | hathach <[email protected]> | 2018-07-24 20:51:50 +0700 |
| commit | a6fede4962fb65bfb353c3a4a4f927c3fc501eb2 (patch) | |
| tree | 773885e9dc2a04c1e9d6b56addc1364154a5c2d4 /src/class/hid/hid_device.h | |
| parent | b370283174fbdb066bc662f8885956dbf947559b (diff) | |
improve tud_hid_mouse API()
Diffstat (limited to 'src/class/hid/hid_device.h')
| -rw-r--r-- | src/class/hid/hid_device.h | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/src/class/hid/hid_device.h b/src/class/hid/hid_device.h index ba8a5a4a1..659981a48 100644 --- a/src/class/hid/hid_device.h +++ b/src/class/hid/hid_device.h @@ -122,10 +122,19 @@ ATTR_WEAK void tud_hid_keyboard_set_report_cb(hid_report_type_t report_type, uin bool tud_hid_mouse_ready(void);
bool tud_hid_mouse_data(uint8_t buttons, int8_t x, int8_t y, int8_t scroll, int8_t pan);
-bool tud_hid_mouse_move(int8_t x, int8_t y, int8_t scroll, int8_t pan);
-bool tud_hid_mouse_button_press(uint8_t buttons);
-bool tud_hid_mouse_button_release(uint8_t buttons);
+bool tud_hid_mouse_move(int8_t x, int8_t y);
+bool tud_hid_mouse_scroll(int8_t vertical, int8_t horizontal);
+
+static inline bool tud_hid_mouse_button_press(uint8_t buttons)
+{
+ return tud_hid_mouse_data(buttons, 0, 0, 0, 0);
+}
+
+static inline bool tud_hid_mouse_button_release(void)
+{
+ return tud_hid_mouse_data(0, 0, 0, 0, 0);
+}
/*------------- Callbacks -------------*/
|
