libxkbcommon
0.2.0
|
Main libxkbcommon API. More...
#include <stdint.h>
#include <stdio.h>
#include <stdarg.h>
#include <xkbcommon/xkbcommon-names.h>
#include <xkbcommon/xkbcommon-keysyms.h>
#include <xkbcommon/xkbcommon-compat.h>
Go to the source code of this file.
Data Structures | |
struct | xkb_rule_names |
Names to compile a keymap with, also known as RMLVO. More... |
Macros | |
#define | XKB_MOD_INVALID (0xffffffff) |
#define | XKB_LAYOUT_INVALID (0xffffffff) |
#define | XKB_KEYCODE_INVALID (0xffffffff) |
#define | XKB_LEVEL_INVALID (0xffffffff) |
#define | XKB_LED_INVALID (0xffffffff) |
#define | XKB_KEYCODE_MAX (0xffffffff - 1) |
#define | xkb_keycode_is_legal_ext(key) (key <= XKB_KEYCODE_MAX) |
Test whether a value is a valid extended keycode. | |
#define | xkb_keycode_is_legal_x11(key) (key >= 8 && key <= 255) |
Test whether a value is a valid X11 keycode. | |
#define | XKB_KEYMAP_USE_ORIGINAL_FORMAT ((enum xkb_keymap_format) -1) |
Get the keymap as a string in the format from which it was created. |
Typedefs | |
typedef uint32_t | xkb_keycode_t |
A number used to represent a physical key on a keyboard. | |
typedef uint32_t | xkb_keysym_t |
A number used to represent the symbols visible on the keycaps of a keyboard. | |
typedef uint32_t | xkb_mod_index_t |
Index of a modifier. | |
typedef uint32_t | xkb_mod_mask_t |
A mask of modifier indexes. | |
typedef uint32_t | xkb_layout_index_t |
Index of a keyboard layout. | |
typedef uint32_t | xkb_layout_mask_t |
A mask of layout indexes. | |
typedef uint32_t | xkb_level_index_t |
Index of a shift level. | |
typedef uint32_t | xkb_led_index_t |
Index of a keyboard LED. | |
typedef uint32_t | xkb_led_mask_t |
A mask of LED indexes. |
Functions | |
int | xkb_keysym_get_name (xkb_keysym_t keysym, char *buffer, size_t size) |
Get the name of a keysym. | |
xkb_keysym_t | xkb_keysym_from_name (const char *name, enum xkb_keysym_flags flags) |
Get a keysym from its name. | |
int | xkb_keysym_to_utf8 (xkb_keysym_t keysym, char *buffer, size_t size) |
Get the Unicode/UTF-8 representation of a keysym. | |
uint32_t | xkb_keysym_to_utf32 (xkb_keysym_t keysym) |
Get the Unicode/UTF-32 representation of a keysym. |
Main libxkbcommon API.
#define xkb_keycode_is_legal_ext | ( | key | ) | (key <= XKB_KEYCODE_MAX) |
Test whether a value is a valid extended keycode.
#define xkb_keycode_is_legal_x11 | ( | key | ) | (key >= 8 && key <= 255) |
Test whether a value is a valid X11 keycode.
typedef uint32_t xkb_keycode_t |
A number used to represent a physical key on a keyboard.
A standard PC-compatible keyboard might have 102 keys. An appropriate keymap would assign each of them a keycode, by which the user should refer to the key throughout the library.
Historically, the X11 protocol, and consequentially the XKB protocol, assign only 8 bits for keycodes. This limits the number of different keys that can be used simultaneously in a single keymap to 256 (disregarding other limitations). This library does not share this limit; keycodes beyond 255 ('extended keycodes') are not treated specially. Keymaps and applications which are compatible with X11 should not use these keycodes.
typedef uint32_t xkb_keysym_t |
A number used to represent the symbols visible on the keycaps of a keyboard.
A key, represented by a keycode, may generate different symbols according to keyboard state. For example, on a QWERTY keyboard, pressing the key labled <A> generates the symbol 'a'. If the Shift key is held, it generates the symbol 'A'. If a different layout is used, say Greek, it generates the symbol 'α'. And so on.
Each such symbol is represented by a keysym. Note that keysyms are somewhat more general, in that they can also represent some "function", such as "Left" or "Right" for the arrow keys. For more information, see: http://www.x.org/releases/X11R7.7/doc/xproto/x11protocol.html#keysym_encoding
Specifically named keysyms can be found in the xkbcommon/xkbcommon-keysyms.h header file. Their name does not include the XKB_KEY_ prefix.
Besides those, any Unicode/ISO 10646 character in the range U0100 to U10FFFF can be represented by a keysym value in the range 0x01000100 to 0x0110FFFF. The name of Unicode keysyms is "U<codepoint>", e.g. "Ua1b2".
The name of other unnamed keysyms is the hexadecimal representation of their value, e.g. "0xabcd1234".
Keysym names are case-sensitive.
typedef uint32_t xkb_mod_index_t |
Index of a modifier.
Modifier indexes are consecutive. The first modifier has index 0.
Each modifier must have a name, and the names are unique. Therefore, it is safe to use the name as a unique identifier for a modifier. Modifier names are case-sensitive.
typedef uint32_t xkb_mod_mask_t |
A mask of modifier indexes.
typedef uint32_t xkb_layout_index_t |
Index of a keyboard layout.
Layout indexes are consecutive. The first layout has index 0.
Each layout is not required to have a name, and the names are not guarenteed to be unique (though they are usually provided and unique). Therefore, it is not safe to use the name as a unique identifier for a layout. Layout names are case-sensitive.
Layouts are also called "groups" by XKB.
typedef uint32_t xkb_layout_mask_t |
A mask of layout indexes.
typedef uint32_t xkb_level_index_t |
Index of a shift level.
typedef uint32_t xkb_led_index_t |
Index of a keyboard LED.
LED indexes are non-consecutive. The first LED has index 0.
LED names are case-sensitive.
Each LED must have a name, and the names are unique. Therefore, it is safe to use the name as a unique identifier for a LED.
LEDs are also called "indicators" by XKB.
typedef uint32_t xkb_led_mask_t |
A mask of LED indexes.