TKeyRecord record
Key event decoding type.
Declaration
TKeyRecord = packed recordDescription
The structure of a TKeyRecord structure is explained in the
following table:
| Field | Meaning |
|---|---|
| KeyCode | Depending on flags either the physical representation of a key
(under DOS scancode, ASCII code pair), or the translated
ASCII/Unicode character.
|
| ShiftState | Shift-state when this key was pressed (or shortly after) |
| Flags | Determine how to interpret KeyCode
|
The shift-state can be checked using the various shift-state constants, and the flags in the last byte can be checked using one of the kbASCII, kbUniCode, kbFnKey, kbPhys, kbReleased constants.
If there are two keys returning the same char-code, there's no way to find out which one was pressed (Gray+ and Simple+). If it needs to be known which was pressed, the untranslated keycodes must be used, but these are system dependent. System dependent constants may be defined to cover those, with possibly having the same name (but different value).
See also
Fields
Flags | Additional flags. | |
ShiftState | State of shift keys. | |
KeyCode | Key code. |
An experiment, built from development snapshots. Not the official Free Pascal or Lazarus documentation.
