The library comes with the struct that let you send 6 keys at once. But i want to send more. I have edited the Arduino standard leyboard library to allow this for others microcontrollers like ameta32u4.
USBHIDKeyboard.h
typedef struct {
uint8_t modifiers;
uint8_t reserved;
uint8_t keys[6];
} KeyReport;
But in ESP32-S3 the library is different and i make the changes but the moment i change the hid.h struct that uses when doing the send report it stop working and nothing is send.
hid.h
typedef struct TU_ATTR_PACKED
{
uint8_t modifier; /**< Keyboard modifier (KEYBOARD_MODIFIER_* masks). */
uint8_t reserved; /**< Reserved for OEM use, always set to 0. */
uint8_t keycode[6]; /**< Key codes of the currently pressed keys. */
} hid_keyboard_report_t;
USBHIDKeyboard.cpp
void USBHIDKeyboard::sendReport(KeyReport* keys)
{
hid_keyboard_report_t report;
report.reserved = 0;
report.modifier = keys->modifiers;
if (keys->keys) {
memcpy(report.keycode, keys->keys, 6);
} else {
memset(report.keycode, 0, 6);
}
hid.SendReport(HID_REPORT_ID_KEYBOARD, &report, sizeof(report));
}
Everywhere that appears a 6 I want to change it to 61 without making it fail. What am i missing.