libxkbcommon
0.2.0
|
Opaque keyboard state object. More...
#include <xkbcommon.h>
Public Member Functions | |
struct xkb_state * | xkb_state_new (struct xkb_keymap *keymap) |
Create a new keyboard state object for a keymap. | |
struct xkb_state * | xkb_state_ref (struct xkb_state *state) |
Take a new reference on a keyboard state object. | |
void | xkb_state_unref (struct xkb_state *state) |
Release a reference on a keybaord state object, and possibly free it. | |
struct xkb_keymap * | xkb_state_get_keymap (struct xkb_state *state) |
Get the keymap from which a keyboard state object was created. | |
enum xkb_state_component | xkb_state_update_key (struct xkb_state *state, xkb_keycode_t key, enum xkb_key_direction direction) |
Update the keyboard state to reflect a given key being pressed or released. | |
int | xkb_state_key_get_syms (struct xkb_state *state, xkb_keycode_t key, const xkb_keysym_t **syms_out) |
Get the keysyms obtained from pressing a particular key in a given keyboard state. | |
xkb_keysym_t | xkb_state_key_get_one_sym (struct xkb_state *state, xkb_keycode_t key) |
Get the single keysym obtained from pressing a particular key in a given keyboard state. | |
xkb_layout_index_t | xkb_state_key_get_layout (struct xkb_state *state, xkb_keycode_t key) |
Get the effective layout index for a key in a given keyboard state. | |
xkb_level_index_t | xkb_state_key_get_level (struct xkb_state *state, xkb_keycode_t key, xkb_layout_index_t layout) |
Get the effective shift level for a key in a given keyboard state and layout. | |
enum xkb_state_component | xkb_state_update_mask (struct xkb_state *state, xkb_mod_mask_t depressed_mods, xkb_mod_mask_t latched_mods, xkb_mod_mask_t locked_mods, xkb_layout_index_t depressed_layout, xkb_layout_index_t latched_layout, xkb_layout_index_t locked_layout) |
Update a keyboard state from a set of explicit masks. | |
xkb_mod_mask_t | xkb_state_serialize_mods (struct xkb_state *state, enum xkb_state_component components) |
The counterpart to xkb_state_update_mask for modifiers, to be used on the server side of serialization. | |
xkb_layout_index_t | xkb_state_serialize_layout (struct xkb_state *state, enum xkb_state_component components) |
The counterpart to xkb_state_update_mask for layouts, to be used on the server side of serialization. | |
int | xkb_state_mod_name_is_active (struct xkb_state *state, const char *name, enum xkb_state_component type) |
Test whether a modifier is active in a given keyboard state by name. | |
int | xkb_state_mod_names_are_active (struct xkb_state *state, enum xkb_state_component type, enum xkb_state_match match,...) |
Test whether a set of modifiers are active in a given keyboard state by name. | |
int | xkb_state_mod_index_is_active (struct xkb_state *state, xkb_mod_index_t idx, enum xkb_state_component type) |
Test whether a modifier is active in a given keyboard state by index. | |
int | xkb_state_mod_indices_are_active (struct xkb_state *state, enum xkb_state_component type, enum xkb_state_match match,...) |
Test whether a set of modifiers are active in a given keyboard state by index. | |
int | xkb_state_mod_index_is_consumed (struct xkb_state *state, xkb_keycode_t key, xkb_mod_index_t idx) |
Test whether a modifier is consumed by keyboard state translation for a key. | |
xkb_mod_mask_t | xkb_state_mod_mask_remove_consumed (struct xkb_state *state, xkb_keycode_t key, xkb_mod_mask_t mask) |
Remove consumed modifiers from a modifier mask for a key. | |
int | xkb_state_layout_name_is_active (struct xkb_state *state, const char *name, enum xkb_state_component type) |
Test whether a layout is active in a given keyboard state by name. | |
int | xkb_state_layout_index_is_active (struct xkb_state *state, xkb_layout_index_t idx, enum xkb_state_component type) |
Test whether a layout is active in a given keyboard state by index. | |
int | xkb_state_led_name_is_active (struct xkb_state *state, const char *name) |
Test whether a LED is active in a given keyboard state by name. | |
int | xkb_state_led_index_is_active (struct xkb_state *state, xkb_led_index_t idx) |
Test whether a LED is active in a given keyboard state by index. |
Opaque keyboard state object.
State objects contain the active state of a keyboard (or keyboards), such as the currently effective layout and the active modifiers. It acts as a simple state machine, wherein key presses and releases are the input, and key symbols (keysyms) are the output.
A state object is created, accessed, manipulated and destroyed through the xkb_state_*() API.