Difference between revisions of "Unit Keymap"
Line 78: | Line 78: | ||
! '''Note''' | ! '''Note''' | ||
| Called only during system startup | | Called only during system startup | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | |||
+ | '''Keymap functions''' | ||
+ | |||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function KeymapLoad(Header:PKeymapHeader; Data:PKeymapData; Size:LongWord):TKeymapHandle;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Load a Keymap from a keymap data block and add to the Keymap table</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Header''' | ||
+ | | Pointer to the keymap header | ||
+ | |- | ||
+ | ! '''Data''' | ||
+ | | Pointer to the keymap data | ||
+ | |- | ||
+ | ! '''Size''' | ||
+ | | Size of the keymap data | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | Handle of the newly loaded keymap or INVALID_HANDLE_VALUE on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function KeymapLoadEx(Header:PKeymapHeader; Data:PKeymapData; Capskeys:PKeymapCapskeys; Deadkeys:PKeymapDeadkeys; Size:LongWord; Properties:PKeymapProperties):TKeymapHandle;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Load a Keymap from a keymap data block and add to the Keymap table</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Header''' | ||
+ | | Pointer to the keymap header (See TKeymapHeader) | ||
+ | |- | ||
+ | ! '''Data''' | ||
+ | | Pointer to the keymap data (See TKeymapData) | ||
+ | |- | ||
+ | ! '''Capskeys''' | ||
+ | | Pointer to the capskeys table (Optional) | ||
+ | |- | ||
+ | ! '''Deadkeys''' | ||
+ | | Pointer to the deadkeys table (Optional) | ||
+ | |- | ||
+ | ! '''Size''' | ||
+ | | Size of the keymap data | ||
+ | |- | ||
+ | ! '''Properties''' | ||
+ | | Pointer to a keymap properties record to use instead of the header (Optional) | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | Handle of the newly loaded keymap or INVALID_HANDLE_VALUE on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function KeymapUnload(Handle:TKeymapHandle):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Unload an existing keymap and remove from the Keymap table</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Handle''' | ||
+ | | The handle of the keymap to unload | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function KeymapGetName(Handle:TKeymapHandle):String;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the name of the specified keymap</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Handle''' | ||
+ | | The handle of the keymap to get the name for | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | The name of the keymap (eg US) | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function KeymapGetDescription(Handle:TKeymapHandle):String;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the description of the specified keymap</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Handle''' | ||
+ | | The handle of the keymap to get the description for | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | The description of the keymap (eg US English) | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function KeymapCheckFlag(Handle:TKeymapHandle; Flag:LongWord):Boolean;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Check if a specified keymap has a particular flag set or not</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Handle''' | ||
+ | | The handle of the keymap to check the flag for | ||
+ | |- | ||
+ | ! '''Flag''' | ||
+ | | The flag value to check (eg KEYMAP_FLAG_CAPS_ASCII) | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | True if the flag is set and False if not set | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function KeymapGetKeyCode(Handle:TKeymapHandle; ScanCode:Word; Index:Byte):Word;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Resolve a scan code and index value to a key code using the specified keymap</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Handle''' | ||
+ | | The handle of the keymap to use for translation | ||
+ | |- | ||
+ | ! '''ScanCode''' | ||
+ | | The keyboard scan code value to resolve (eg SCAN_CODE_A) | ||
+ | |- | ||
+ | ! '''Index''' | ||
+ | | The keymap index to use for the translation (eg KEYMAP_INDEX_SHIFT) | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | The translated key code value (eg KEY_CODE_A) or KEY_CODE_NONE on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function KeymapGetCharCode(Handle:TKeymapHandle; KeyCode:Word):Char;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Resolve a key code value to an ANSI character code using the specified keymap</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Handle''' | ||
+ | | The handle of the keymap to use for translation | ||
+ | |- | ||
+ | ! '''KeyCode''' | ||
+ | | The key code value to resolve (eg KEY_CODE_A) | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | The ANSI character value for the keycode or 0 on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function KeymapGetCharUnicode(Handle:TKeymapHandle; KeyCode:Word):WideChar;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Resolve a key code value to a Unicode character code using the specified keymap</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Handle''' | ||
+ | | The handle of the keymap to use for translation | ||
+ | |- | ||
+ | ! '''KeyCode''' | ||
+ | | The key code value to resolve (eg KEY_CODE_A) | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | The Unicode character value for the keycode or 0 on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function KeymapCheckCapskey(Handle:TKeymapHandle; ScanCode:Word):Boolean;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Check if a scan code is affected by the Caps Lock key in the specified keymap</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Handle''' | ||
+ | | The handle of the keymap to check | ||
+ | |- | ||
+ | ! '''ScanCode''' | ||
+ | | The scan code value to check (eg SCAN_CODE_A) | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | True if affected by Caps Lock, False if not | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function KeymapCheckDeadkey(Handle:TKeymapHandle; ScanCode:Word; Index:Byte):Boolean;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Check if a scan code represents a Dead Key in the specified keymap</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Handle''' | ||
+ | | The handle of the keymap to check | ||
+ | |- | ||
+ | ! '''ScanCode''' | ||
+ | | The scan code value to check (eg SCAN_CODE_A) | ||
+ | |- | ||
+ | ! '''Index''' | ||
+ | | The keymap index to check (eg KEYMAP_INDEX_SHIFT) | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | True if the scan key is a Dead Key, False if not | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function KeymapResolveDeadkey(Handle:TKeymapHandle; DeadCode,ScanCode:Word; DeadIndex,ScanIndex:Byte; var KeyCode:Word):Boolean;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Resolve a Dead Key and the next scan code to a key code value</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Handle''' | ||
+ | | The handle of the keymap to use for resolution | ||
+ | |- | ||
+ | ! '''DeadCode''' | ||
+ | | The scan code value of the dead key (eg SCAN_CODE_GRAVE) | ||
+ | |- | ||
+ | ! '''ScanCode''' | ||
+ | | The scan code value of the next key (eg (SCAN_CODE_A) | ||
+ | |- | ||
+ | ! '''DeadIndex''' | ||
+ | | The keymap index of the dead key (eg KEYMAP_INDEX_SHIFT) | ||
+ | |- | ||
+ | ! '''ScanIndex''' | ||
+ | | The keymap index of the next key (eg KEYMAP_INDEX_SHIFT) | ||
+ | |- | ||
+ | ! '''KeyCode''' | ||
+ | | Return value for the key code represented by the dead key / next key combination (or KEY_CODE_NONE) | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | True if the dead key / next key combination resolves to a key code or False if not | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function KeymapGetProperties(Handle:TKeymapHandle; Properties:PKeymapProperties):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Get the properties of the specified keymap</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Handle''' | ||
+ | | The handle of the keymap to get the properties for | ||
+ | |- | ||
+ | ! '''Properties''' | ||
+ | | Pointer to a keymap properties structure to return the properties | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | ERROR_SUCCESS if completed or another error code on failure | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function KeymapFindByName(const Name:String):TKeymapHandle; </pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Find a keymap by name</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Name''' | ||
+ | | The name of the keymap to find (eg US) | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | The handle of the matching keymap or INVALID_HANDLE_VALUE if not found | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function KeymapFindByDescription(const Description:String):TKeymapHandle;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Find a keymap by description</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Description''' | ||
+ | | The description of the keymap to find (eg US English) | ||
+ | |- | ||
+ | ! '''Return''' | ||
+ | | The handle of the matching keymap or INVALID_HANDLE_VALUE if not found | ||
+ | |- | ||
+ | |} | ||
+ | </div></div> | ||
+ | <br /> | ||
+ | <div class="toccolours mw-collapsible mw-collapsed" style="border: 1; font-family: arial; padding-top: 0px; padding-bottom: 15px;"> | ||
+ | <pre style="border: 0; padding-bottom:0px;">function KeymapEnumerate(Callback:TKeymapEnumerate; Data:Pointer):LongWord;</pre> | ||
+ | <div style="font-size: 14px; padding-left: 12px;">'''Description:''' Enumerate all loaded keymaps</div> | ||
+ | <div class="mw-collapsible-content" style="text-align: left; padding-left: 5px;"> | ||
+ | {| class="wikitable" style="font-size: 14px; background: white;" | ||
+ | |- | ||
+ | ! '''Callback''' | ||
+ | | The function to call for each loaded keymap | ||
+ | |- | ||
+ | ! '''Data''' | ||
+ | | A private data pointer to pass to callback for each loaded keymap | ||
|- | |- | ||
|} | |} |
Revision as of 01:12, 19 August 2016
Return to Unit Reference
Description
Keymaps
Keymaps define the translation of a keyboard scan code (the SCAN_CODE_* values) to a key code value (the KEY_CODE_* values) and provide the ability to handle different keyboard layouts in different countries and regions.
The keyboard scan codes are based on the values in Section 10 of the Universal Serial Bus HID Usage Tables v1.12 and are the actual values returned by the keyboard when a key is pressed.
The key code values are based on the Unicode standard with each key code mapped to the code point for that character.
This allows almost infinite flexibility in the way keyboard scan codes are mapped to actual characters and avoids the need to make unreliable assumptions about ASCII characters and upper or lower case handling.
Since the output of the keyboard is a stream of TKeyboardData structures containing both the scan code and the key code then higher level functions can retranslate the data in any way required.
Caps Keys
Caps keys account for the set of keys which are affected by Caps Lock in any given keyboard layout.
In some layouts only the alphabetic keys are affected, in other layouts some or all of the numeric and punctuation keys are also affected.
The caps keys data for any keyboard layout allows defining ranges of keys that are affected by the Caps Lock state.
Dead Keys
Dead keys account for the set of keys which behave as dead keys in any given keyboard layout.
On pressing a deadkey it will be recognized by the keyboard as such and stored until the next key press occurs. If the next keypress is one of the resolves for the pressed dead key then theoutput character will be the key code value of the resolve not for the key itself.
If the next keypress after a dead key is not one of the resolves that the dead key and the pressed key will both be output to the keyboard buffer.
Setting the default keymap for the system
Additional keymaps are provided as units which can be included in a program and will auto load themselves if included.
All keymap units are configured to check for both the environment variable KEYMAP_DEFAULT and the global configuration variable KEYMAP_DEFAULT to determine if either of them is set to the name of that keymap. If either is set to the keymap name then that keymap will also set itself as the default during system startup.
The environment variable KEYMAP_DEFAULT can be set by adding KEYMAP_DEFAULT=XX (where XX is the name of the keymap, eg DE for Keymap_DE) to the command line of the application (dependant onthe system, for a Raspberry Pi use the cmdline.txt file on the SD card).
The global configuration variable KEYMAP_DEFAULT can be set in code by including the GlobalConfig unit in a program and setting the variable during startup.
At any time after startup the default keymap can be changed by call the KeymapSetDefault function.
Constants
To be documented
Type definitions
To be documented
Public variables
To be documented
Function declarations
Initialization functions
procedure KeymapInit;
Note | Called only during system startup |
---|
Keymap functions
function KeymapLoad(Header:PKeymapHeader; Data:PKeymapData; Size:LongWord):TKeymapHandle;
Header | Pointer to the keymap header |
---|---|
Data | Pointer to the keymap data |
Size | Size of the keymap data |
Return | Handle of the newly loaded keymap or INVALID_HANDLE_VALUE on failure |
function KeymapLoadEx(Header:PKeymapHeader; Data:PKeymapData; Capskeys:PKeymapCapskeys; Deadkeys:PKeymapDeadkeys; Size:LongWord; Properties:PKeymapProperties):TKeymapHandle;
Header | Pointer to the keymap header (See TKeymapHeader) |
---|---|
Data | Pointer to the keymap data (See TKeymapData) |
Capskeys | Pointer to the capskeys table (Optional) |
Deadkeys | Pointer to the deadkeys table (Optional) |
Size | Size of the keymap data |
Properties | Pointer to a keymap properties record to use instead of the header (Optional) |
Return | Handle of the newly loaded keymap or INVALID_HANDLE_VALUE on failure |
function KeymapUnload(Handle:TKeymapHandle):LongWord;
Handle | The handle of the keymap to unload |
---|---|
Return | ERROR_SUCCESS if completed or another error code on failure |
function KeymapGetName(Handle:TKeymapHandle):String;
Handle | The handle of the keymap to get the name for |
---|---|
Return | The name of the keymap (eg US) |
function KeymapGetDescription(Handle:TKeymapHandle):String;
Handle | The handle of the keymap to get the description for |
---|---|
Return | The description of the keymap (eg US English) |
function KeymapCheckFlag(Handle:TKeymapHandle; Flag:LongWord):Boolean;
Handle | The handle of the keymap to check the flag for |
---|---|
Flag | The flag value to check (eg KEYMAP_FLAG_CAPS_ASCII) |
Return | True if the flag is set and False if not set |
function KeymapGetKeyCode(Handle:TKeymapHandle; ScanCode:Word; Index:Byte):Word;
Handle | The handle of the keymap to use for translation |
---|---|
ScanCode | The keyboard scan code value to resolve (eg SCAN_CODE_A) |
Index | The keymap index to use for the translation (eg KEYMAP_INDEX_SHIFT) |
Return | The translated key code value (eg KEY_CODE_A) or KEY_CODE_NONE on failure |
function KeymapGetCharCode(Handle:TKeymapHandle; KeyCode:Word):Char;
Handle | The handle of the keymap to use for translation |
---|---|
KeyCode | The key code value to resolve (eg KEY_CODE_A) |
Return | The ANSI character value for the keycode or 0 on failure |
function KeymapGetCharUnicode(Handle:TKeymapHandle; KeyCode:Word):WideChar;
Handle | The handle of the keymap to use for translation |
---|---|
KeyCode | The key code value to resolve (eg KEY_CODE_A) |
Return | The Unicode character value for the keycode or 0 on failure |
function KeymapCheckCapskey(Handle:TKeymapHandle; ScanCode:Word):Boolean;
Handle | The handle of the keymap to check |
---|---|
ScanCode | The scan code value to check (eg SCAN_CODE_A) |
Return | True if affected by Caps Lock, False if not |
function KeymapCheckDeadkey(Handle:TKeymapHandle; ScanCode:Word; Index:Byte):Boolean;
Handle | The handle of the keymap to check |
---|---|
ScanCode | The scan code value to check (eg SCAN_CODE_A) |
Index | The keymap index to check (eg KEYMAP_INDEX_SHIFT) |
Return | True if the scan key is a Dead Key, False if not |
function KeymapResolveDeadkey(Handle:TKeymapHandle; DeadCode,ScanCode:Word; DeadIndex,ScanIndex:Byte; var KeyCode:Word):Boolean;
Handle | The handle of the keymap to use for resolution |
---|---|
DeadCode | The scan code value of the dead key (eg SCAN_CODE_GRAVE) |
ScanCode | The scan code value of the next key (eg (SCAN_CODE_A) |
DeadIndex | The keymap index of the dead key (eg KEYMAP_INDEX_SHIFT) |
ScanIndex | The keymap index of the next key (eg KEYMAP_INDEX_SHIFT) |
KeyCode | Return value for the key code represented by the dead key / next key combination (or KEY_CODE_NONE) |
Return | True if the dead key / next key combination resolves to a key code or False if not |
function KeymapGetProperties(Handle:TKeymapHandle; Properties:PKeymapProperties):LongWord;
Handle | The handle of the keymap to get the properties for |
---|---|
Properties | Pointer to a keymap properties structure to return the properties |
Return | ERROR_SUCCESS if completed or another error code on failure |
function KeymapFindByName(const Name:String):TKeymapHandle;
Name | The name of the keymap to find (eg US) |
---|---|
Return | The handle of the matching keymap or INVALID_HANDLE_VALUE if not found |
function KeymapFindByDescription(const Description:String):TKeymapHandle;
Description | The description of the keymap to find (eg US English) |
---|---|
Return | The handle of the matching keymap or INVALID_HANDLE_VALUE if not found |
function KeymapEnumerate(Callback:TKeymapEnumerate; Data:Pointer):LongWord;
Callback | The function to call for each loaded keymap |
---|---|
Data | A private data pointer to pass to callback for each loaded keymap |
Return to Unit Reference