diff options
| author | tobozo <[email protected]> | 2023-03-30 21:57:06 +0200 |
|---|---|---|
| committer | tobozo <[email protected]> | 2023-03-30 21:57:06 +0200 |
| commit | a77aaf7f9e8a86c904d0bf6e8994288f45b3b410 (patch) | |
| tree | d38f680f7a25f5ce0e508a3705132f3c63cf5c51 /src/class/hid/hid_device.c | |
| parent | 290f18a1fe4551cb0376d356627bda595c621518 (diff) | |
Added helpers for abs_mouse_report
Diffstat (limited to 'src/class/hid/hid_device.c')
| -rw-r--r-- | src/class/hid/hid_device.c | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/class/hid/hid_device.c b/src/class/hid/hid_device.c index 9240fe2ca..7e28b2c94 100644 --- a/src/class/hid/hid_device.c +++ b/src/class/hid/hid_device.c @@ -146,6 +146,19 @@ bool tud_hid_n_mouse_report(uint8_t instance, uint8_t report_id, return tud_hid_n_report(instance, report_id, &report, sizeof(report)); } +bool tud_hid_n_abs_mouse_report(uint8_t instance, uint8_t report_id, uint8_t buttons, int16_t x, int16_t y, int8_t vertical, int8_t horizontal) +{ + hid_abs_mouse_report_t report = + { + .buttons = buttons, + .x = x, + .y = y, + .wheel = vertical, + .pan = horizontal + }; + return tud_hid_n_report(instance, report_id, &report, sizeof(report)); +} + bool tud_hid_n_gamepad_report(uint8_t instance, uint8_t report_id, int8_t x, int8_t y, int8_t z, int8_t rz, int8_t rx, int8_t ry, uint8_t hat, uint32_t buttons) { hid_gamepad_report_t report = |
