PreviousNext

Keyboard Report Format

Size: 9 bytes, fixed-length.

Structure: REPORT ID (1) MODIFIER (1) RESERVED (1) KEYCODES (6)

Values in parentheses indicate the size, in bytes, of the field.

Important: The host application does not need to understand and process Keyboard Reports. This task belongs to the host operating system. Keycodes are passed to the host application as if a user were typing keyboard text. The host application must be the active application in order to receive keystrokes.

Keyboard Reports protocol requires that two reports be sent for every keystroke. The first report indicates which key is pressed. The second report indicates "no key pressed", with all keycodes NUL (0x00) to indicate that all keys have been released. In the case of the MS-4 Imager, each byte output is equivalent to a keystroke, with a "key pressed" report and a "no key pressed" report. For this reason, data rates are much slower when using Keyboard Reports.

Field Descriptions

REPORT ID

Size: 1 byte

Value: 0x02

Note: Report ID is the method employed by USB HID to allow multiple report formats to be sent and received from the same interface.

MODIFIER

Size: 1 byte

Value: 0x00 to 0xFF

Note: Modifier is an 8 bit field, corresponding to the state of the modifier keys at the time the keycode field was generated.

Bit
Key
0
LEFT CTRL
1
LEFT SHIFT
2
LEFT ALT
3
LEFT GUI
4
RIGHT CTRL
5
RIGHT SHIFT
6
RIGHT ALT
7
RIGHT GUI

Field Descriptions

RESERVED

Size: 1 byte

Value: 0x00

Note: This field is Reserved. Its value is always NUL (0x00).

KEYCODES

Size: 6 bytes

Value: 0x00 to 0xFF

Note: The MS-4 Imager translates 8 bit data values into Keycode data in the following ways:

8 Bit Data Value
Keycode Data
0x00 to 0x1F and 0x7F to 0xFF
Decimal key ( . ) unless otherwise noted.
CR, 0x0D
Enter key
TAB, 0x09
Tab key
ESC, 0x1B
ESC key
"Printable" characters, 0x20 to 0x7E
These all translate to the keystrokes that produce them. This includes a-z, 0-9, punctuation, and SHIFT in the Modifier field, when necessary. Only the first Keycode in the 6 byte array will be populated.


PreviousNext