Bird Computer - Virtual Keycodes
© 2004 Bird Computer
This document describes the Bird Computer Virtual Keycode system. The virtual keycode system's purpose is to support keyboard and other input devices. It is desirable to use Unicode characters to represent the incoming character stream from the keyboard or other device, however Unicode was not really meant for that purpose; it's not a sufficient code to support keyboard input, and is meant more as an enabler for document storage and display. Supporting keyboard input is really outside of the intent of Unicode.
While Unicode does support almost every character imaginable, programs need more than just raw characters from a keyboard; programs also need things like cursor, edit controls, shift and pause indicators. When dealing with a keyboard there is also a need to be able to tell when a key is pressed and when it is released. This is useful for instance in marking text for a block copy operation by holding the shift key down while moving the cursor keys.
Unfortunately Unicode contains more than 65536 characters (or more characters than will fit into a sixteen bit value.) While in theory there is no limit to the number of characters that Unicode can support it is probably practically limited. Currently it can be represented by an 18 bit value. This system allows 24 bits just in case. This virtual keycode definition uses 32 bit keycodes. Some of the bits in the definition are not used. The most significant bit is used to indicate whether the key is being pressed or released. The low order 24 bits of the keycode are directly mapped to the Unicode standard character. The next couple of bits are used to select between a normal Unicode character and the Bird Computer extended keycodes. The remaining bits are unused.
Virtual Keycode Format:
|31||30 26||25 24||23 0|
u/d - 0 = key pressed down, 1 = key released
sel - 0 = Unicode character, 1 = extended input character, 2,3 = unused
Edit controls group
|11||F1 / Help|