![]() |
Ultibo API
C/C++ API for Ultibo Core
|
Go to the source code of this file.
Data Structures | |
| struct | _KEYMAP_HEADER |
| struct | _KEYMAP_DATA |
| struct | _KEYMAP_CAPSKEY |
| struct | _KEYMAP_CAPSKEYS |
| struct | _KEYMAP_RESOLVE |
| struct | _KEYMAP_DEADKEY |
| struct | _KEYMAP_DEADKEYS |
| struct | _KEYMAP_PROPERTIES |
| struct | _KEYMAP_ENTRY |
Macros | |
| #define | KEYMAP_KEY_COUNT 256 |
| Number of key mappings in a keymap entry. | |
| #define | KEYMAP_ROW_COUNT 4 |
| Number of mapping rows per key in a keymap entry (Normal, Shift, AltGr, Shift_AltGr). | |
| #define | KEYMAP_ROW_SIZE sizeof(uint16_t) |
| #define | KEYMAP_MAX_CAPSKEYS 50 |
| Maximum number of keys that can be listed in the TKeymapCapskeys structure. | |
| #define | KEYMAP_MAX_DEADKEYS 5 |
| Maximum number of keys that can be listed in the TKeymapDeadkeys structure. | |
| #define | KEYMAP_MAX_RESOLVES 20 |
| Maximum number of resolves that can be listed in the TKeymapDeadkey structure. | |
| #define | KEYMAP_SIGNATURE 0x863FDBA1 |
| #define | KEYMAP_NAME_LENGTH SIZE_64 |
| Length of keymap name. | |
| #define | KEYMAP_DESC_LENGTH SIZE_128 |
| Length of keymap description. | |
| #define | KEYMAP_MODE_NONE 0 |
| #define | KEYMAP_FLAG_NONE 0x00000000 |
| #define | KEYMAP_FLAG_ALTGR 0x00000001 |
| The key mapping uses the AltGr key. | |
| #define | KEYMAP_FLAG_CAPS_ALL 0x00000002 |
| Caps Lock shifts all characters not just alphabetic. | |
| #define | KEYMAP_FLAG_CAPS_ASCII 0x00000004 |
| Caps Lock shifts only ASCII characters A to Z. | |
| #define | KEYMAP_INDEX_NORMAL 0 |
| Normal (unshifted) value. | |
| #define | KEYMAP_INDEX_SHIFT 1 |
| Shifted value. | |
| #define | KEYMAP_INDEX_ALTGR 2 |
| AltGr value. | |
| #define | KEYMAP_INDEX_SHIFT_ALTGR 3 |
| Shift plus AltGr value. | |
| #define | KEYMAP_INDEX_COUNT 4 |
Typedefs | |
| typedef struct _KEYMAP_HEADER | KEYMAP_HEADER |
| typedef struct _KEYMAP_DATA | KEYMAP_DATA |
| typedef uint16_t | KEYMAP_CHARS[] |
| typedef struct _KEYMAP_CAPSKEY | KEYMAP_CAPSKEY |
| typedef struct _KEYMAP_CAPSKEYS | KEYMAP_CAPSKEYS |
| typedef struct _KEYMAP_RESOLVE | KEYMAP_RESOLVE |
| typedef struct _KEYMAP_DEADKEY | KEYMAP_DEADKEY |
| typedef struct _KEYMAP_DEADKEYS | KEYMAP_DEADKEYS |
| typedef struct _KEYMAP_PROPERTIES | KEYMAP_PROPERTIES |
| typedef struct _KEYMAP_ENTRY | KEYMAP_ENTRY |
| typedef uint32_t STDCALL(* | keymap_enumerate_cb) (KEYMAP_HANDLE handle, void *data) |
Functions | |
| KEYMAP_HANDLE STDCALL | keymap_load (KEYMAP_HEADER *header, KEYMAP_DATA *data, uint32_t size) |
| Load a Keymap from a keymap data block and add to the Keymap table. | |
| KEYMAP_HANDLE STDCALL | keymap_load_ex (KEYMAP_HEADER *header, KEYMAP_DATA *data, KEYMAP_CAPSKEYS *capskeys, KEYMAP_DEADKEYS *deadkeys, uint32_t size, KEYMAP_PROPERTIES *properties) |
| Load a Keymap from a keymap data block and add to the Keymap table. | |
| uint32_t STDCALL | keymap_unload (KEYMAP_HANDLE handle) |
| Unload an existing keymap and remove from the Keymap table. | |
| uint32_t STDCALL | keymap_get_name (KEYMAP_HANDLE handle, char *name, uint32_t len) |
| Get the name of the specified keymap. | |
| uint32_t STDCALL | keymap_get_description (KEYMAP_HANDLE handle, char *description, uint32_t len) |
| Get the description of the specified keymap. | |
| BOOL STDCALL | keymap_check_flag (KEYMAP_HANDLE handle, uint32_t flag) |
| Check if a specified keymap has a particular flag set or not. | |
| uint16_t STDCALL | keymap_get_key_code (KEYMAP_HANDLE handle, uint16_t scancode, uint8_t index) |
| Resolve a scan code and index value to a key code using the specified keymap. | |
| char STDCALL | keymap_get_char_code (KEYMAP_HANDLE handle, uint16_t keycode) |
| Resolve a key code value to an ANSI character code using the specified keymap. | |
| WCHAR STDCALL | keymap_get_char_unicode (KEYMAP_HANDLE handle, uint16_t keycode) |
| Resolve a key code value to a Unicode character code using the specified keymap. | |
| BOOL STDCALL | keymap_check_capskey (KEYMAP_HANDLE handle, uint16_t scancode) |
| Check if a scan code is affected by the Caps Lock key in the specified keymap. | |
| BOOL STDCALL | keymap_check_deadkey (KEYMAP_HANDLE handle, uint16_t scancode, uint8_t index) |
| Check if a scan code represents a Dead Key in the specified keymap. | |
| BOOL STDCALL | keymap_resolve_deadkey (KEYMAP_HANDLE handle, uint16_t deadcode, uint16_t scancode, uint8_t deadindex, uint8_t scanindex, uint16_t *keycode) |
| Resolve a Dead Key and the next scan code to a key code value. | |
| uint32_t STDCALL | keymap_get_properties (KEYMAP_HANDLE handle, KEYMAP_PROPERTIES *properties) |
| Get the properties of the specified keymap. | |
| KEYMAP_HANDLE STDCALL | keymap_find_by_name (const char *name) |
| Find a keymap by name. | |
| KEYMAP_HANDLE STDCALL | keymap_find_by_description (const char *description) |
| Find a keymap by description. | |
| uint32_t STDCALL | keymap_enumerate (keymap_enumerate_cb callback, void *data) |
| Enumerate all loaded keymaps. | |
| uint32_t STDCALL | keymap_get_count (void) |
| Get the current keymap count. | |
| KEYMAP_HANDLE STDCALL | keymap_get_default (void) |
| Get the current default keymap. | |
| uint32_t STDCALL | keymap_set_default (KEYMAP_HANDLE handle) |
| Set the current default keymap. | |
| KEYMAP_ENTRY *STDCALL | keymap_check (KEYMAP_ENTRY *keymap) |
| Check if the supplied Keymap is in the Keymap table. | |
| #define KEYMAP_KEY_COUNT 256 |
Number of key mappings in a keymap entry.
Keymap specific constants
| #define KEYMAP_ROW_COUNT 4 |
Number of mapping rows per key in a keymap entry (Normal, Shift, AltGr, Shift_AltGr).
| #define KEYMAP_ROW_SIZE sizeof(uint16_t) |
| #define KEYMAP_MAX_CAPSKEYS 50 |
Maximum number of keys that can be listed in the TKeymapCapskeys structure.
| #define KEYMAP_MAX_DEADKEYS 5 |
Maximum number of keys that can be listed in the TKeymapDeadkeys structure.
| #define KEYMAP_MAX_RESOLVES 20 |
Maximum number of resolves that can be listed in the TKeymapDeadkey structure.
| #define KEYMAP_SIGNATURE 0x863FDBA1 |
Keymap Signature
| #define KEYMAP_NAME_LENGTH SIZE_64 |
Length of keymap name.
Keymap name constants
| #define KEYMAP_DESC_LENGTH SIZE_128 |
Length of keymap description.
| #define KEYMAP_MODE_NONE 0 |
Keymap Mode constants
| #define KEYMAP_FLAG_NONE 0x00000000 |
Keymap Flag constants
| #define KEYMAP_FLAG_ALTGR 0x00000001 |
The key mapping uses the AltGr key.
| #define KEYMAP_FLAG_CAPS_ALL 0x00000002 |
Caps Lock shifts all characters not just alphabetic.
| #define KEYMAP_FLAG_CAPS_ASCII 0x00000004 |
Caps Lock shifts only ASCII characters A to Z.
| #define KEYMAP_INDEX_NORMAL 0 |
Normal (unshifted) value.
Keymap Index constants
| #define KEYMAP_INDEX_SHIFT 1 |
Shifted value.
| #define KEYMAP_INDEX_ALTGR 2 |
AltGr value.
| #define KEYMAP_INDEX_SHIFT_ALTGR 3 |
Shift plus AltGr value.
| #define KEYMAP_INDEX_COUNT 4 |
| typedef struct _KEYMAP_HEADER KEYMAP_HEADER |
Keymap specific types Keymap Header
| typedef struct _KEYMAP_DATA KEYMAP_DATA |
Keymap Data
| typedef uint16_t KEYMAP_CHARS[] |
Keymap Chars
| typedef struct _KEYMAP_CAPSKEY KEYMAP_CAPSKEY |
Keymap Capskey (Keys affected by the Caps Lock function)
| typedef struct _KEYMAP_CAPSKEYS KEYMAP_CAPSKEYS |
Keymap Capskeys
| typedef struct _KEYMAP_RESOLVE KEYMAP_RESOLVE |
Keymap Resolve
| typedef struct _KEYMAP_DEADKEY KEYMAP_DEADKEY |
Keymap Deadkey (Keys which behave as dead keys)
| typedef struct _KEYMAP_DEADKEYS KEYMAP_DEADKEYS |
Keymap Deadkeys
| typedef struct _KEYMAP_PROPERTIES KEYMAP_PROPERTIES |
Keymap Properties
| typedef struct _KEYMAP_ENTRY KEYMAP_ENTRY |
| typedef uint32_t STDCALL(* keymap_enumerate_cb) (KEYMAP_HANDLE handle, void *data) |
Keymap Enumeration Callback
| KEYMAP_HANDLE STDCALL keymap_load | ( | KEYMAP_HEADER * | header, |
| KEYMAP_DATA * | data, | ||
| uint32_t | size ) |
Load a Keymap from a keymap data block and add to the Keymap table.
Keymap Functions
| Header | Pointer to the keymap header |
| Data | Pointer to the keymap data |
| Size | Size of the keymap data |
| KEYMAP_HANDLE STDCALL keymap_load_ex | ( | KEYMAP_HEADER * | header, |
| KEYMAP_DATA * | data, | ||
| KEYMAP_CAPSKEYS * | capskeys, | ||
| KEYMAP_DEADKEYS * | deadkeys, | ||
| uint32_t | size, | ||
| KEYMAP_PROPERTIES * | properties ) |
Load a Keymap from a keymap data block and add to the Keymap table.
| 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) |
| uint32_t STDCALL keymap_unload | ( | KEYMAP_HANDLE | handle | ) |
Unload an existing keymap and remove from the Keymap table.
| Handle | The handle of the keymap to unload |
| uint32_t STDCALL keymap_get_name | ( | KEYMAP_HANDLE | handle, |
| char * | name, | ||
| uint32_t | len ) |
Get the name of the specified keymap.
| Handle | The handle of the keymap to get the name for |
| uint32_t STDCALL keymap_get_description | ( | KEYMAP_HANDLE | handle, |
| char * | description, | ||
| uint32_t | len ) |
Get the description of the specified keymap.
| Handle | The handle of the keymap to get the description for |
| BOOL STDCALL keymap_check_flag | ( | KEYMAP_HANDLE | handle, |
| uint32_t | flag ) |
Check if a specified keymap has a particular flag set or not.
| Handle | The handle of the keymap to check the flag for |
| Flag | The flag value to check (eg KEYMAP_FLAG_CAPS_ASCII) |
| uint16_t STDCALL keymap_get_key_code | ( | KEYMAP_HANDLE | handle, |
| uint16_t | scancode, | ||
| uint8_t | index ) |
Resolve a scan code and index value to a key code using the specified keymap.
| 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) |
| char STDCALL keymap_get_char_code | ( | KEYMAP_HANDLE | handle, |
| uint16_t | keycode ) |
Resolve a key code value to an ANSI character code using the specified keymap.
| Handle | The handle of the keymap to use for translation |
| KeyCode | The key code value to resolve (eg KEY_CODE_A) |
| WCHAR STDCALL keymap_get_char_unicode | ( | KEYMAP_HANDLE | handle, |
| uint16_t | keycode ) |
Resolve a key code value to a Unicode character code using the specified keymap.
| Handle | The handle of the keymap to use for translation |
| KeyCode | The key code value to resolve (eg KEY_CODE_A) |
| BOOL STDCALL keymap_check_capskey | ( | KEYMAP_HANDLE | handle, |
| uint16_t | scancode ) |
Check if a scan code is affected by the Caps Lock key in the specified keymap.
| Handle | The handle of the keymap to check |
| ScanCode | The scan code value to check (eg SCAN_CODE_A) |
| BOOL STDCALL keymap_check_deadkey | ( | KEYMAP_HANDLE | handle, |
| uint16_t | scancode, | ||
| uint8_t | index ) |
Check if a scan code represents a Dead Key in the specified keymap.
| 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) |
| BOOL STDCALL keymap_resolve_deadkey | ( | KEYMAP_HANDLE | handle, |
| uint16_t | deadcode, | ||
| uint16_t | scancode, | ||
| uint8_t | deadindex, | ||
| uint8_t | scanindex, | ||
| uint16_t * | keycode ) |
Resolve a Dead Key and the next scan code to a key code value.
| 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) |
| uint32_t STDCALL keymap_get_properties | ( | KEYMAP_HANDLE | handle, |
| KEYMAP_PROPERTIES * | properties ) |
Get the properties of the specified keymap.
| Handle | The handle of the keymap to get the properties for |
| Properties | Pointer to a keymap properties structure to return the properties |
| KEYMAP_HANDLE STDCALL keymap_find_by_name | ( | const char * | name | ) |
Find a keymap by name.
| Name | The name of the keymap to find (eg US) |
| KEYMAP_HANDLE STDCALL keymap_find_by_description | ( | const char * | description | ) |
Find a keymap by description.
| Description | The description of the keymap to find (eg US English) |
| uint32_t STDCALL keymap_enumerate | ( | keymap_enumerate_cb | callback, |
| void * | data ) |
Enumerate all loaded keymaps.
| Callback | The function to call for each loaded keymap |
| Data | A private data pointer to pass to callback for each loaded keymap |
| uint32_t STDCALL keymap_get_count | ( | void | ) |
Get the current keymap count.
Keymap Helper Functions
| KEYMAP_HANDLE STDCALL keymap_get_default | ( | void | ) |
Get the current default keymap.
| uint32_t STDCALL keymap_set_default | ( | KEYMAP_HANDLE | handle | ) |
Set the current default keymap.
| KEYMAP_ENTRY *STDCALL keymap_check | ( | KEYMAP_ENTRY * | keymap | ) |
Check if the supplied Keymap is in the Keymap table.