xkbcommon 1.14.0-beta2
Reference library implementing the XKB specification for parsing keyboard descriptions and handling keyboard state
Loading...
Searching...
No Matches
Functions
Client keyboard state
Collaboration diagram for Client keyboard state:

Functions

XKB_EXPORT enum xkb_state_component xkb_state::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)
 

Detailed Description

Client-specific API.

Function Documentation

◆ xkb_state_update_mask()

XKB_EXPORT 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.

This entry point is intended for client applications; see Server State and Client State for details. Server applications should use either the recommended modern xkb_machine API with the corresponding xkb_state_update_event() or the legacy xkb_state_update_synthetic() API instead.

Parameters
[in,out]stateThe keyboard state object.
[in]depressed_modsModifiers to set as depressed.
[in]latched_modsModifiers to set as latched.
[in]locked_modsModifiers to set as locked.
[in]depressed_layoutLayout to set as depressed.
[in]latched_layoutLayout to set as latched.
[in]locked_layoutLayout to set as locked.
Precondition
All parameters must represent a consistent snapshot of the server keyboard state at a single point in time. In case the server provides only a single layout state (e.g. the effective layout in the Wayland protocol), it should be used for locked_layout, while depressed_layout and latched_layout are both set to 0.

@important If state was not created with XKB_STATE_MODE_CLIENT or xkb_state_new(), the call is rejected without updating the state, and the misuse is logged as XKB_ERROR_UNEXPECTED_STATE_MODE. The return value is 0 in this case, which is indistinguishable from a no-op update.

Returns
A mask of state components that have changed as a result of the update. If nothing in the state has changed, returns 0 (XKB_STATE_NO_COMPONENT).
See also
enum xkb_state_component
xkb_state_update_synthetic()
xkb_state_update_event()
Since
1.14.0: Reject call if the state mode is incorrect.