Changes

Jump to navigation Jump to search
612 bytes added ,  18:49, 23 March 2008
Added keyboard connect/disconnect info. Removed stub template.
Line 1: Line 1: −
{{stub}}
  −
   
==Description==
 
==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.
 +
 +
The device can be opened and closed even without a keyboard connected. Performing an ioctl on the device in this state will simply block forever.
    
==Write==
 
==Write==
Line 28: Line 28:  
==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 will block.
+
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"
 
{| border="1"
Line 35: Line 35:  
! Offset !! Length !! Contents
 
! Offset !! Length !! Contents
 
|-
 
|-
| 0 || 8 || Unknown
+
| 0 || 4 || [[#Message type|Message type]]
 +
|-
 +
| 4 || 4 || Unknown (keyboard identifier?)
 
|-
 
|-
 
| 8 || 1 || [[#Modifiers|Modifiers]]
 
| 8 || 1 || [[#Modifiers|Modifiers]]
Line 43: Line 45:  
| 10 || 6 || [[#Key data|Pressed keys]]
 
| 10 || 6 || [[#Key data|Pressed keys]]
 
|}
 
|}
 +
 +
===Message type===
 +
 +
Message type is one of the following:
 +
 +
{| border="1"
 +
|-
 +
! Hex value !! Description
 +
|-
 +
| 00 00 00 00 || Keyboard connect
 +
|-
 +
| 00 00 00 01 || Keyboard disconnect
 +
|-
 +
| 00 00 00 02 || Event
 +
|}
 +
 +
You will always be properly notified of available keyboards. This means that when the device is opened ''after'' the keyboard is connected, a keyboard connect event is still received as the very first message.
    
===Modifiers===
 
===Modifiers===
Line 51: Line 70:  
! Bit no. !! Hex value !! Description
 
! Bit no. !! Hex value !! Description
 
|-
 
|-
| 1 || 0x01 || Left control
+
| 1 || 01 || Left control
 
|-
 
|-
| 2 || 0x02 || Left shift
+
| 2 || 02 || Left shift
 
|-
 
|-
| 3 || 0x04 || Left alt / left meta
+
| 3 || 04 || Left alt / left meta
 
|-
 
|-
| 4 || 0x08 || Left super / left windows key
+
| 4 || 08 || Left super / left windows key
 
|}
 
|}
   Line 64: Line 83:  
! Bit no. !! Hex value !! Description
 
! Bit no. !! Hex value !! Description
 
|-
 
|-
| 5 || 0x10 || Right control
+
| 5 || 10 || Right control
 
|-
 
|-
| 6 || 0x20 || Right shift
+
| 6 || 20 || Right shift
 
|-
 
|-
| 7 || 0x40 || Right alt / right meta / alt gr
+
| 7 || 40 || Right alt / right meta / alt gr
 
|-
 
|-
| 8 || 0x80 || Right super / right windows key
+
| 8 || 80 || Right super / right windows key
 
|}
 
|}
 
<div style="clear:both;"></div>
 
<div style="clear:both;"></div>
15

edits

Navigation menu