Developers guide
Chapter 9: Keyboard
Keyboard Remapping
Psion Teklogix Mobile Devices SDK Developers Guide 57
All Psion Teklogix computers have non-chorded keyboards. A non-chorded keyboard is a key-
board that does not handle simultaneous key presses. Each key pressed generates a unique scan
code which is not modified by the state of other keys on the keyboard.
Modifier keys are keys on the keyboard that when pressed and released set a mode that can
change the behaviour of other keys on the keyboard. The following keys are modifier keys:
[BLUE],[ORANGE], [ALT], [CTRL], and [SHIFT]. These can change the virtual key code value
generated by a subsequent scan code.
A virtual key code is a device-independent value defined by the system that identifies the purpose
of a key, and is what informs an application about which key was pressed. Scan codes are mapped
to virtual key codes by the keyboard driver. A single scan code can map to multiple virtual key
codes, dependent on the current state of the [ORANGE], [BLUE] and [SHIFT] modifier keys.
The mapping between the scan codes and the virtual key codes is defined in a set of tables. There
are separate tables to define the code mappings for normal operation, and for when the [SHIFT],
[ORANGE] or [BLUE] modifiers are active. However, only the [ORANGE] and [BLUE] tables
can be remapped, the [SHIFT] table cannot.
The [CTRL] and [ALT] modifier keys do not change the virtual key code generated, thus there are
no key code tables for those modifiers. However, an application can detect the state of these mod-
ifiers upon receiving a virtual key code, and change its behaviour accordingly.
A function in keyboard remapping terminology is an operation that is performed when a particu-
lar scan code is generated by a key press. This operation may modify the virtual key code
generated, or cause some other effect such as changing the backlight intensity. The following
types of functions are available:
• Macro—maps a scan code to a macro key, which is then mapped into a sequence of one of
more virtual key codes. No virtual key code is generated (other than those defined in the
macro sequence).
• Operation only—maps a scan code to some specific behaviour (e.g. backlight intensity). No
virtual key code is generated.
• Modifier key mapping—causes a scan code to simulate the pressing of a modifier key, in
order to correctly update the modifier key state. Normal sequence for modifier keys is: off ->
one shot -> locked -> off).
• Virtual key (+modifier)—maps a scan code to a virtual key code, and may simulate the press-
ing of one or more modifier keys.
• Direct Unicode mapping—maps a scan code directly to a Unicode character. This enables
characters to be generated which have no virtual key equivalents., such as accented characters.
• Null mapping—causes a scan code to be ignored.
A scan code mapping can involve all of these elements. A scan code generated by a key can be
mapped to a function, and possibly also to a virtual key, macro index, or Unicode character value.
Some characters do not have virtual key codes, but can be generated using shifted-key codes. For
example, a '+' character is actually generated by sending a shifted '=' virtual key code (that is, the
scan code is mapped to VK_EQUAL and the function Function.SendShiftedCode). These map-
pings can be inferred from a standard PC keyboard.
If two threads or processes attempt to modify the keyboard scan code mappings at the same time,
the results are undefined.










