xkbcommon 1.14.0-beta2
Reference library implementing the XKB specification for parsing keyboard descriptions and handling keyboard state
Loading...
Searching...
No Matches
Data Fields
xkb_machine_builder_mods_remap_update Struct Reference

#include <xkbcommon.h>

Data Fields

uint32_t size
 
xkb_mod_mask_t source
 
xkb_mod_mask_t target
 

Detailed Description

Modifiers remapping update for xkb_machine_builder::xkb_machine_builder_update_mods_remap().

Remap a modifier combination, e.g. to make Control+Alt act as LevelThree (AltGr). This helps improve compatibility across platforms.

The remapping takes effect only using xkb_machine::xkb_machine_process_key() and under certain conditions:

Example: remap Control+Alt to LevelThree.

struct xkb_keymap *keymap = xkb_machine_builder_get_keymap(builder);
const xkb_mod_mask_t ctrl = xkb_keymap_mod_get_mask(keymap, XKB_MOD_NAME_CTRL);
const xkb_mod_mask_t alt = xkb_keymap_mod_get_mask(keymap, XKB_VMOD_NAME_ALT);
const xkb_mod_mask_t level3 = xkb_keymap_mod_get_mask(keymap, XKB_VMOD_NAME_LEVEL3);
.size = sizeof(update),
.source = ctrl | alt,
.target = level3
};
const enum xkb_error_code error =
xkb_machine_builder_update_mods_remap(builder, &update);
if (error != XKB_SUCCESS) {
// handle error
assert(!"error");
}
xkb_error_code
Error codes returned by the API.
Definition xkbcommon-errors.h:53
@ XKB_SUCCESS
The operation completed successfully.
Definition xkbcommon-errors.h:68
#define XKB_VMOD_NAME_LEVEL3
Definition xkbcommon-names.h:60
#define XKB_VMOD_NAME_ALT
Definition xkbcommon-names.h:56
Opaque compiled keymap object.
Modifiers remapping update for xkb_machine_builder::xkb_machine_builder_update_mods_remap().
Definition xkbcommon.h:4216
xkb_mod_mask_t target
Modifier combination to remap to, using their encoding, or 0 to remove the entry for source.
Definition xkbcommon.h:4244
xkb_mod_mask_t source
Modifier combination to remap, using their encoding.
Definition xkbcommon.h:4234
uint32_t size
Size of this structure in bytes.
Definition xkbcommon.h:4224
uint32_t xkb_mod_mask_t
Definition xkbcommon.h:362
Note
This struct uses a size-based versioning; see Extensible structure ABI contract for further details.
See also
xkb_keymap::xkb_keymap_mod_get_mask()
xkb_machine_builder::xkb_machine_builder_update_mods_remap()
Since
1.14.0

Field Documentation

◆ size

uint32_t xkb_machine_builder_mods_remap_update::size

Size of this structure in bytes.

See also
Extensible structure ABI contract
Since
1.14.0

◆ source

xkb_mod_mask_t xkb_machine_builder_mods_remap_update::source

Modifier combination to remap, using their encoding.

Must be non-zero, unless both source and target are 0 to clear all entries.

Since
1.14.0

◆ target

xkb_mod_mask_t xkb_machine_builder_mods_remap_update::target

Modifier combination to remap to, using their encoding, or 0 to remove the entry for source.

If both source and target are 0, all entries are cleared.

Since
1.14.0

The documentation for this struct was generated from the following file: