Skip to content
Discussion options

You must be logged in to vote

In order to find the vmod → rmod mapping, you may use the following:

// Please use these named constants whenever possible
#include <xkbcommon/xkbcommon-names.h>
#ifndef XKB_VMOD_NAME_LEVEL3
#define XKB_VMOD_NAME_LEVEL3 "LevelThree"
#endif

const xkb_mod_index_t levelThree_idx = xkb_keymap_mod_get_index(keymap, XKB_VMOD_NAME_LEVEL3);
const xkb_mod_mask_t levelThree = UINT32_C(1) << levelThree_idx;
struct xkb_state *state = xkb_state_new(keymap);
assert(state); // TODO: handle error properly
xkb_state_update_mask(state, levelThree, 0, 0, 0, 0, 0);
const xkb_mod_mask_t levelThree_mapping = xkb_state_serialize_mods(state, XKB_STATE_MODS_EFFECTIVE);
xkb_state_unref(state);

This should work wi…

Replies: 1 comment 7 replies

Comment options

You must be logged in to vote
7 replies
@wismill
Comment options

@johnp
Comment options

@wismill
Comment options

@johnp
Comment options

@wismill
Comment options

Answer selected by wismill
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Help
Labels
None yet
2 participants