Page 1 of 1

USB_KEY_SPACEBAR from the UsageTables doesnt work

Posted: Thu Oct 16, 2008 3:10 am
by epsilon_da
I have done a way to download information from my device simulating keypresses in a text editor. (Like one of the comunity examples)
Everything works except for the Spacebar key, which is number 44 or 0x2C.
I send in the report a 0 for modifiers and 44 for the key.

My HID Descriptor is copyed from HIDKeys.

//==========================================================================
//=========================== AVR-USB Configuration (HID Descriptor) =======
//==========================================================================
PROGMEM char usbHidReportDescriptor[35] = { /* USB report descriptor */
0x05, 0x01, // USAGE_PAGE (Generic Desktop)
0x09, 0x06, // USAGE (Keyboard)
0xa1, 0x01, // COLLECTION (Application)
0x05, 0x07, // USAGE_PAGE (Keyboard)
0x19, 0xe0, // USAGE_MINIMUM (Keyboard LeftControl)
0x29, 0xe7, // USAGE_MAXIMUM (Keyboard Right GUI)
0x15, 0x00, // LOGICAL_MINIMUM (0)
0x25, 0x01, // LOGICAL_MAXIMUM (1)
0x75, 0x01, // REPORT_SIZE (1)
0x95, 0x08, // REPORT_COUNT (8)
0x81, 0x02, // INPUT (Data,Var,Abs)
0x95, 0x01, // REPORT_COUNT (1)
0x75, 0x08, // REPORT_SIZE (8)
0x25, 0x65, // LOGICAL_MAXIMUM (101)
0x19, 0x00, // USAGE_MINIMUM (Reserved (no event indicated))
0x29, 0x65, // USAGE_MAXIMUM (Keyboard Application)
0x81, 0x00, // INPUT (Data,Ary,Abs)
0xc0 // END_COLLECTION
};




To add some wear things, in page 53 of USB HID Usage Tables file says as follow:
The usage type of all key codes is Selectors (Sel), except for the modifier keys Keyboard Left Control
(0x224) to Keyboard Right GUI (0x231) which are Dynamic Flags (DV).


BUT "Keyboard Left Control" is 224 in dec and 0xE0 in hex as state in the table. The same for "Keyboard Right GUI". Also are different from the typical definitions (1 << 0) and (1 << 7).



Is this my error of interpretation? And 44 is not the number for the spacebar? (Letters and numbers works fine)