|
xkbcommon 1.14.0-beta2
Reference library implementing the XKB specification for parsing keyboard descriptions and handling keyboard state
|
Functions | |
| XKB_EXPORT struct xkb_state * | xkb_state::xkb_state_new_from_machine (const struct xkb_machine *machine, enum xkb_status *status) |
| XKB_EXPORT enum xkb_status | xkb_state::xkb_state_update_event (struct xkb_state *state, const struct xkb_event *event, enum xkb_state_component *changed) |
xkb_machine companion-specific API.
| XKB_EXPORT struct xkb_state * xkb_state_new_from_machine | ( | const struct xkb_machine * | machine, |
| enum xkb_status * | status | ||
| ) |
Create a new keyboard state object as an observer of an xkb_machine.
Constructor for server applications using the xkb_machine API:
XKB_STATE_MODE_SERVER_QUERY;machine’s keymap;machine’s state;xkb_machine.See Server State and Client State for further information.
xkb_state_update_event().| [in] | machine | The state machine whose keymap the new state will use. |
| [out] | status | Pointer to store the resulting status code, or NULL if not needed. |
NULL on failure. The returned xkb_state shares ownership of the xkb_keymap associated with machine via a new reference.status is not NULL, *status is set to XKB_SUCCESS on success or to an error code corresponding to the failure. Possible errors are:
xkb_state_new_with_mode() XKB_STATE_MODE_SERVER_QUERY struct xkb_machine| XKB_EXPORT enum xkb_status xkb_state_update_event | ( | struct xkb_state * | state, |
| const struct xkb_event * | event, | ||
| enum xkb_state_component * | changed | ||
| ) |
Update the keyboard state components from an event.
This entry point serves the companion role of xkb_machine. It is intended for server applications and should not be used by client applications; see Server State and Client State for details.
It enables server applications to use xkb_state as the observable state companion to an xkb_machine: feed each event produced by xkb_machine::xkb_machine_process_key() or xkb_machine::xkb_machine_process_synthetic() into this function to keep the observable state in sync.
| [in,out] | state | The keyboard state object. |
| [in] | event | The state event to update from. |
| [out] | changed | A pointer to the mask of state components that have changed as a result of the update, or NULL to ignore. If nothing in the state has changed, the mask is set to 0 (XKB_STATE_NO_COMPONENT). |
state must be created with xkb_state_new_from_machine() (i.e. with mode XKB_STATE_MODE_SERVER_QUERY) or xkb_state_new(), otherwise the call is rejected without updating the state and the misuse is logged as XKB_ERROR_UNEXPECTED_STATE_MODE.XKB_SUCCESS on success;XKB_ERROR_UNEXPECTED_STATE_MODE without updating the state if state was not created with XKB_STATE_MODE_SERVER_QUERY or xkb_state_new().xkb_state_update_*() functions), in order to align with xkb_state_update_synthetic() API. The delta is optionally available via the changed parameter.xkb_state_new_from_machine()