[Overview][Constants][Types][Procedures and functions] | Reference for unit 'keyboard' (#rtl) |
Key event decoding type.
Source position: keybrdh.inc line 22
type TKeyRecord = packed record |
||
KeyCode: Word; |
|
Key code |
ShiftState: Byte; |
|
State of shift keys |
Flags: Byte; |
|
Additional flags |
end; |
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 possibily having the same name (but different value).
|
Keyboard scan codes |
|
|
Base type to describe all key events. |
No notes exist for this page yet.