Yes. This ought to do it in the report descriptor.
Code:
0x95, 0x1E, // Report Count (30),
0x75, 0x08, // Report Size (8),
0x15, 0x00, // Logical Minimum (0),
0x25, 0x7F, // Logical Maximum(104),
There's other stuff to modify too...
In usb_private.h, change KEYBOARD_SIZE to 32.
Code:
#define KEYBOARD_SIZE 32
Since this no longer complies with the boot protocol, edit the 2 boot protocol numbers in usb.c in the keyboard interface to zero.
Code:
0x03, // bInterfaceClass (0x03 = HID)
0x00, // bInterfaceSubClass (0x01 = Boot)
0x00, // bInterfaceProtocol (0x01 = Keyboard)
Change the size of keyboard_report_data to 32 bytes:
Code:
// byte1: media keys (TODO: document these)
// bytes2-7: which keys are currently pressed, up to 6 keys may be down at once
uint8_t keyboard_report_data[8] USBSTATE;
In usb_init(), add code to clear the new 24 bytes.
There are 2 places in usb.c that transmit the keyboard report. You'll need to edit both of them to send all 32 bytes.
Code:
for (i=0; i < 32; i++) {
UEDATX = keyboard_report_data[i];
}
UEINTX = 0x3A;
Then you're ready to edit the code in usb_api.cpp, which actually does the work of sending your keys.
The 6 keys are used in usb_keyboard_class::write_key and usb_keyboard_class::send_now. Just add another 24 lines for the new bytes, or write it to use a loop if you like. Then add more usb_keyboard_class::set_key* functions for the 24 new bytes. Or you could just write directly into the array from your program.
I believe that's everything you'll need to edit. I might have missed something? If you try this, please post here to let us know how it goes? If you get it working, I hope you'll post the edited code in case anyone else wants to use this.