Hi all,
Thanks for your contineous support from this site.
I want to detect my board as HID mouse when plugged to USB port of PC. For that I guess I need to write HID mouse driver.
I am using LPC2148 controller. Can i gett some reference code for it?
Thanks & Regards, Kamal
> so I wonder why the standard keyboard has the report in data format is 8, is it redundant??
Keyboard puts an input report which shows the current status of all keys (snapshot) - not just the key which makes or breaks. Keyboard puts input reports regularly, or just at the timing when any key-down/-up occurs (*1). In either case, the input report is a snapshot of all keys.
The format of the standard input report for keyboard is as follows,
Byte 0 Modifier keys bitmap of left and right CTRL, SHIFT, ALT, GUI keys 1 Reserved 2 Keycode array[0] 6 byte keycode array for the keys other than modifier 3 Keycode array[1] 4 Keycode array[2] 5 Keycode array[3] 6 Keycode array[4] 7 Keycode array[5]
The Modifier keys field holds the ON/OFF status of the modifier keys on each bit, just when the report is made. The Keycode array lists up only the keys which are currently ON, up to six keys - 6-keys rollover (*2).
Comparing the last report and new one, HID host knows make/break of keys. If a keycode appears in the new report, but not in the last one, the key makes. If a keycode is shown again in the new report, the key is still pressed. If a keycode disappears in the new report, the key is released.
Thanking to this format, shooting games on your PC is able to move the hero diagonally, when you push the up and left cursor keys at the same time. Also you can fire while you are moving :-)
I don't know why a reserved byte is there between the modifier and the array. Maybe, they thought more modifier keys may be equipped in future.
(*1) chosen by SET_IDLE requests (*2) Increasing the array size on the report descriptor, input report can hold more keys. For example, 100-keys rollover :-)
Tsuneo
Dear Tsuneo and Per Westermark,
Thanks so much for your sharing! I think I've got what I need.
Tuong Nguyen