Key Codes

Each key on a computer's keyboard is assigned a numerical code which is reported as the key field in the B_KEY_DOWN or B_UNMATCHED_KEY_DOWN message. Likewise, the key field of the B_KEY_UP or B_UNMATCHED_KEY_UP message indicates which key was released.

The Print Screen key is trapped by BeOS; it doesn't generate a key down message, but it does generate a key up.

The following illustration shows the keycodes for most of the keys on standard keyboards.

Info Icon

Some keyboards vary slightly from this; however, even if keys are in different locations than those depicted here, they'll still have the same key code values.

Note that the Option key on Macintosh keyboards and the Windows key on many PC keyboards share the same keycode.

Some other keys that don't appear on this diagram include:

KeyKeycode
System Request0x7E
Break0x7F
Euro0x69
Keypad0x6A
Mac Power Key0x6B
Creative Commons License
Legal Notice
This work is licensed under a Creative Commons Attribution-Non commercial-No Derivative Works 3.0 License.