xkbcommon 1.14.0-beta2
Reference library implementing the XKB specification for parsing keyboard descriptions and handling keyboard state
Loading...
Searching...
No Matches
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:

  • The corresponding effective modifiers are active.
  • The key being processed has a type that does not use any of the source modifiers.
  • There is no other remapping entry with the source modifiers being a superset of this entry. E.g. Control+Alt has priority over Control.

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);
.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");
}
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: