Line 1: |
Line 1: |
− | ==Description==
| + | '''/dev/usb/kbd''' is the interface to the USB keyboard driver. |
− | /dev/usb/kbd is the interface to the USB keyboard driver. | |
| | | |
| Reads, seeks and ioctlvs always fail. Writes are used to send commands. Ioctls are used to receive events. | | Reads, seeks and ioctlvs always fail. Writes are used to send commands. Ioctls are used to receive events. |
Line 7: |
Line 6: |
| | | |
| ==Write== | | ==Write== |
− |
| |
| Writes are used the send commands to the driver. This is for controlling the keyboard LEDs. Writes are always 5 bytes in length. | | Writes are used the send commands to the driver. This is for controlling the keyboard LEDs. Writes are always 5 bytes in length. |
| | | |
− | {| border="1" | + | {| class="wikitable" |
| |+ Available commands: | | |+ Available commands: |
| |- | | |- |
Line 27: |
Line 25: |
| | | |
| ==Ioctl== | | ==Ioctl== |
− |
| |
| Ioctls are used to read keyboard events. All parameters except the output buffer are ignored. The buffer should be 16 bytes in size and will be filled with the event data. Note that the ioctl is blocking. | | Ioctls are used to read keyboard events. All parameters except the output buffer are ignored. The buffer should be 16 bytes in size and will be filled with the event data. Note that the ioctl is blocking. |
| | | |
− | {| border="1" | + | {| class="wikitable" |
| |+ Event data format | | |+ Event data format |
| |- | | |- |
Line 47: |
Line 44: |
| | | |
| ===Message type=== | | ===Message type=== |
− |
| |
| Message type is one of the following: | | Message type is one of the following: |
| | | |
− | {| border="1" | + | {| class="wikitable" |
| |- | | |- |
| ! Hex value !! Description | | ! Hex value !! Description |
Line 66: |
Line 62: |
| The modifiers are a bitmask of the following: | | The modifiers are a bitmask of the following: |
| | | |
− | {| border="1" style="text-align: center; float: left;" | + | {|<!-- two tables are embedded in an outer table --> |
| + | |- |
| + | | |
| + | |
| + | {| class="wikitable" style="text-align: center; float: left;" |
| |- | | |- |
| ! Bit no. !! Hex value !! Description | | ! Bit no. !! Hex value !! Description |
Line 79: |
Line 79: |
| |} | | |} |
| | | |
− | {| border="1" style="text-align: center; float: left;" | + | | |
| + | |
| + | {| class="wikitable" style="text-align: center; float: left;" |
| |- | | |- |
| ! Bit no. !! Hex value !! Description | | ! Bit no. !! Hex value !! Description |
Line 91: |
Line 93: |
| | 8 || 80 || Right super / right windows key | | | 8 || 80 || Right super / right windows key |
| |} | | |} |
− | <div style="clear:both;"></div>
| + | |
| + | |} |
| | | |
| ===Key data=== | | ===Key data=== |
− |
| |
| The key data is an array of bytes with key codes. The codes are probably passed directly from the keyboard as they correspond to the table in the USB HID Usage Tables Chapter 10 (Keyboard/Keypad Page), available [http://www.usb.org/developers/hidpage/ here]. | | The key data is an array of bytes with key codes. The codes are probably passed directly from the keyboard as they correspond to the table in the USB HID Usage Tables Chapter 10 (Keyboard/Keypad Page), available [http://www.usb.org/developers/hidpage/ here]. |
| | | |
Line 105: |
Line 107: |
| The following table of key codes was pulled from a Logitech Internet Navigator keyboard, which is a 105 key US layout keyboard with some special keys: | | The following table of key codes was pulled from a Logitech Internet Navigator keyboard, which is a 105 key US layout keyboard with some special keys: |
| | | |
− | {| border="1" style="text-align: center; float:left;" | + | {| |
| + | {| class="wikitable" style="text-align: center; float:left;" |
| |- | | |- |
| ! Dec !! Hex !! Description | | ! Dec !! Hex !! Description |
Line 161: |
Line 164: |
| | 29 || 1d || z | | | 29 || 1d || z |
| |} | | |} |
− | | + | | |
− | {| border="1" style="text-align: center; float:left;" | + | {| class="wikitable" style="text-align: center; float:left;" |
| |- | | |- |
| ! Dec !! Hex !! Description | | ! Dec !! Hex !! Description |
Line 220: |
Line 223: |
| | 57 || 39 || Caps Lock | | | 57 || 39 || Caps Lock |
| |} | | |} |
− | | + | | |
− | {| border="1" style="text-align: center; float:left;" | + | {| class="wikitable" style="text-align: center; float:left;" |
| |- | | |- |
| ! Dec !! Hex !! Description | | ! Dec !! Hex !! Description |
Line 275: |
Line 278: |
| | 82 || 52 || Arrow Up | | | 82 || 52 || Arrow Up |
| |} | | |} |
− | | + | | |
− | {| border="1" style="text-align: center; float:left;" | + | {| class="wikitable" style="text-align: center; float:left;" |
| |- | | |- |
| ! Dec !! Hex !! Description | | ! Dec !! Hex !! Description |
Line 318: |
Line 321: |
| | 101 || 65 || Menu key | | | 101 || 65 || Menu key |
| |} | | |} |
− | <div style="clear:both;"></div>
| + | |} |
| | | |
| [[Category:IOS API documentation]] | | [[Category:IOS API documentation]] |