summaryrefslogtreecommitdiff
path: root/src/class/hid/hid_device.c
diff options
context:
space:
mode:
authorJay <[email protected]>2024-12-23 22:03:37 +0900
committerJay <[email protected]>2024-12-23 22:03:37 +0900
commit15b1623aa3b677100cb7e81bf05f0c3b481d355b (patch)
tree02949b94a96e2073a82dbb6dfbbc581bc1c02bb0 /src/class/hid/hid_device.c
parent7c1afa837a28c7bd5210f57eda4afba4e171cad4 (diff)
add hid stylus pen device.
this works with android, for bypassing that absmouse does not support android. note that, to hide cursor on android for every touch signal, find cursor option in android settings menu. references: 1. https://stackoverflow.com/questions/28536602/hid-digitizer-descriptor-doesnt-perform-well-with-landscape-orientation 2. https://github.com/jonathanedgecombe/absmouse/blob/master/src/AbsMouse.cpp
Diffstat (limited to 'src/class/hid/hid_device.c')
-rw-r--r--src/class/hid/hid_device.c10
1 files changed, 10 insertions, 0 deletions
diff --git a/src/class/hid/hid_device.c b/src/class/hid/hid_device.c
index eedcba984..b4f24902b 100644
--- a/src/class/hid/hid_device.c
+++ b/src/class/hid/hid_device.c
@@ -194,6 +194,16 @@ bool tud_hid_n_gamepad_report(uint8_t instance, uint8_t report_id,
return tud_hid_n_report(instance, report_id, &report, sizeof(report));
}
+bool tud_hid_n_stylus_report(uint8_t instance, uint8_t report_id, uint8_t attrs, uint16_t x, uint16_t y) {
+ hid_stylus_report_t report = {
+ .attr = attrs,
+ .x = x,
+ .y = y,
+ };
+
+ return tud_hid_n_report(instance, report_id, &report, sizeof(report));
+}
+
//--------------------------------------------------------------------+
// USBD-CLASS API
//--------------------------------------------------------------------+