Apple USB Keyboard - special keys question

Question about which tools to use, bugs, the best way to implement a function, etc should go here. Don't forget to see if your question is answered in the wiki first! When in doubt post here.
Post Reply
tom9876543
Member
Member
Posts: 170
Joined: Wed Jul 18, 2007 5:51 am

Apple USB Keyboard - special keys question

Post by tom9876543 »

Hi,
I am testing an USB Apple Pro Keyboard: http://ecx.images-amazon.com/images/I/8 ... L1500_.jpg
Under Linux I used usbmon to get the USB packets from the keyboard - https://www.kernel.org/doc/Documentation/usb/usbmon.txt

Most keys on the apple keyboard generate 8 byte packets as expected.
However, the top right keys (volume down, volume up, mute, eject) generate a 4 byte packet.
Please see usbmon output below.

Does someone know what the 4 byte packets are?
Thanks

Press:
F15, volume down, volume up, mute, eject, Q
Output:

Code: Select all

ffff8801037b7c00 1709114067 C Ii:2:003:1 0:8 8 = 00006a00 00000000
ffff8801037b7c00 1709114120 S Ii:2:003:1 -115:8 8 <
ffff8801037b7c00 1709330063 C Ii:2:003:1 0:8 8 = 00000000 00000000
ffff8801037b7c00 1709330103 S Ii:2:003:1 -115:8 8 <
ffff880103733840 1712198065 C Ii:2:003:2 0:128 4 = 03400000
ffff880103733840 1712198106 S Ii:2:003:2 -115:128 4 <
ffff880103733840 1712454068 C Ii:2:003:2 0:128 4 = 03000000
ffff880103733840 1712454115 S Ii:2:003:2 -115:128 4 <
ffff880103733840 1716294067 C Ii:2:003:2 0:128 4 = 03080000
ffff880103733840 1716294110 S Ii:2:003:2 -115:128 4 <
ffff880103733840 1716550067 C Ii:2:003:2 0:128 4 = 03000000
ffff880103733840 1716550125 S Ii:2:003:2 -115:128 4 <
ffff880103733840 1718854065 C Ii:2:003:2 0:128 4 = 03800000
ffff880103733840 1718854110 S Ii:2:003:2 -115:128 4 <
ffff880103733840 1719110066 C Ii:2:003:2 0:128 4 = 03000000
ffff880103733840 1719110085 S Ii:2:003:2 -115:128 4 <
ffff880103733840 1721542074 C Ii:2:003:2 0:128 4 = 03040000
ffff880103733840 1721542129 S Ii:2:003:2 -115:128 4 <
ffff880103733840 1721798069 C Ii:2:003:2 0:128 4 = 03000000
ffff880103733840 1721798089 S Ii:2:003:2 -115:128 4 <
ffff8801037b7c00 1732466072 C Ii:2:003:1 0:8 8 = 00001400 00000000
ffff8801037b7c00 1732466123 S Ii:2:003:1 -115:8 8 <
ffff8801037b7c00 1732594073 C Ii:2:003:1 0:8 8 = 00000000 00000000
ffff8801037b7c00 1732594124 S Ii:2:003:1 -115:8 8 <
MollenOS
Member
Member
Posts: 202
Joined: Wed Oct 26, 2011 12:00 pm

Re: Apple USB Keyboard - special keys question

Post by MollenOS »

What does the report descriptor tell you about it's input report? Might give a clue to which kinds of data to expect?
tom9876543
Member
Member
Posts: 170
Joined: Wed Jul 18, 2007 5:51 am

Re: Apple USB Keyboard - special keys question

Post by tom9876543 »

HI Mollen,
Thanks for the hint.
I got the report descriptor using usbhid-dump.
Then the web site http://eleccelerator.com/usbdescreqparser/ converted the hex values to human readable strings.
I will have to write USB driver + HID generic driver to fully implement keyboard support. Life was never meant to be easy....

Code: Select all

0x05, 0x01,        // Usage Page (Generic Desktop Ctrls)
0x09, 0x80,        // Usage (Sys Control)
0xA1, 0x01,        // Collection (Application)
0x85, 0x02,        //   Report ID (2)
0x75, 0x01,        //   Report Size (1)
0x95, 0x01,        //   Report Count (1)
0x15, 0x00,        //   Logical Minimum (0)
0x25, 0x01,        //   Logical Maximum (1)
0x09, 0x82,        //   Usage (Sys Sleep)
0x81, 0x06,        //   Input (Data,Var,Rel,No Wrap,Linear,Preferred State,No Null Position)
0x09, 0x82,        //   Usage (Sys Sleep)
0x81, 0x06,        //   Input (Data,Var,Rel,No Wrap,Linear,Preferred State,No Null Position)
0x09, 0x83,        //   Usage (Sys Wake Up)
0x81, 0x06,        //   Input (Data,Var,Rel,No Wrap,Linear,Preferred State,No Null Position)
0x75, 0x05,        //   Report Size (5)
0x81, 0x01,        //   Input (Const,Array,Abs,No Wrap,Linear,Preferred State,No Null Position)
0xC0,              // End Collection
0x05, 0x0C,        // Usage Page (Consumer)
0x09, 0x01,        // Usage (Consumer Control)
0xA1, 0x01,        // Collection (Application)
0x85, 0x03,        //   Report ID (3)
0x95, 0x01,        //   Report Count (1)
0x75, 0x02,        //   Report Size (2)
0x81, 0x01,        //   Input (Const,Array,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x75, 0x01,        //   Report Size (1)
0x09, 0xB8,        //   Usage (Eject)
0x81, 0x06,        //   Input (Data,Var,Rel,No Wrap,Linear,Preferred State,No Null Position)
0x09, 0xE9,        //   Usage (Volume Increment)
0x81, 0x02,        //   Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x75, 0x02,        //   Report Size (2)
0x81, 0x01,        //   Input (Const,Array,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x75, 0x01,        //   Report Size (1)
0x09, 0xEA,        //   Usage (Volume Decrement)
0x81, 0x02,        //   Input (Data,Var,Abs,No Wrap,Linear,Preferred State,No Null Position)
0x09, 0xE2,        //   Usage (Mute)
0x81, 0x06,        //   Input (Data,Var,Rel,No Wrap,Linear,Preferred State,No Null Position)
0x09, 0xCD,        //   Usage (Play/Pause)
0x81, 0x06,        //   Input (Data,Var,Rel,No Wrap,Linear,Preferred State,No Null Position)
0x09, 0xB5,        //   Usage (Scan Next Track)
0x81, 0x06,        //   Input (Data,Var,Rel,No Wrap,Linear,Preferred State,No Null Position)
0x09, 0xB3,        //   Usage (Fast Forward)
0x81, 0x22,        //   Input (Data,Var,Abs,No Wrap,Linear,No Preferred State,No Null Position)
0x09, 0xB4,        //   Usage (Rewind)
0x81, 0x22,        //   Input (Data,Var,Abs,No Wrap,Linear,No Preferred State,No Null Position)
0x09, 0xB6,        //   Usage (Scan Previous Track)
0x81, 0x06,        //   Input (Data,Var,Rel,No Wrap,Linear,Preferred State,No Null Position)
0x09, 0xB7,        //   Usage (Stop)
0x81, 0x06,        //   Input (Data,Var,Rel,No Wrap,Linear,Preferred State,No Null Position)
0x0A, 0x96, 0x01,  //   Usage (AL Internet Browser)
0x81, 0x06,        //   Input (Data,Var,Rel,No Wrap,Linear,Preferred State,No Null Position)
0x0A, 0x8A, 0x01,  //   Usage (AL Email Reader)
0x81, 0x06,        //   Input (Data,Var,Rel,No Wrap,Linear,Preferred State,No Null Position)
0x75, 0x08,        //   Report Size (8)
0x81, 0x01,        //   Input (Const,Array,Abs,No Wrap,Linear,Preferred State,No Null Position)
0xC0,              // End Collection

// 110 bytes
Post Reply