fix mouse reports and improve timeout handling

This commit is contained in:
2025-07-20 21:34:56 -04:00
parent c7d70c669b
commit 99824ee2a6
8 changed files with 357 additions and 400 deletions
+4 -4
View File
@@ -50,8 +50,8 @@ void parse_key_list(char * keys) {
}
void parse_mouse_list (char * keys) {
static unsigned char mouse_report[3];
memset(mouse_report, 0x00, 3);
static unsigned char mouse_report[5];
memset(mouse_report, 0x00, 5);
// Javascript sends the list as comma delimited, so split into individual
// keys by splitting at commas
@@ -75,11 +75,11 @@ void parse_mouse_list (char * keys) {
// print resulting HID boot mouse report to CDC for debugging
printf("Mouse report: ");
for(int i=0; i<3; i++){
for(int i=0; i<5; i++){
printf("%02X ",mouse_report[i]);
}
printf("\n");
tud_hid_report(REPORT_ID_MOUSE, mouse_report, 3);
tud_hid_report(REPORT_ID_MOUSE, mouse_report, 5);
}
// take a single Javascript key code and convert it to USB HID scancode