diff options
author | Jaroslaw Kubik <jarek@froglogic.com> | 2020-02-05 17:42:06 +0100 |
---|---|---|
committer | Ran Benita <ran234@gmail.com> | 2020-03-20 19:20:36 +0200 |
commit | d92a248c48227d09f6fdcfafaf339a5ff586e042 (patch) | |
tree | ebe2a8a30a6db5d6c4ebf10f786983515521eef3 /src/keymap.h | |
parent | 0345aba082c83e9950f9dd8b7ea3bf91fe566a02 (diff) | |
download | xorg-lib-libxkbcommon-d92a248c48227d09f6fdcfafaf339a5ff586e042.tar.gz |
API to query modifier set required to type a keysym
The new API is useful to implement features like auto-type and
desktop automation. Since the inputs for these features is usually
specified in terms of the symbols that need to be typed, the
implementation needs to be able to invert the keycode->keysym
transformation and produce a sequence of keycodes that can be used
to type the requested character(s).
Diffstat (limited to 'src/keymap.h')
-rw-r--r-- | src/keymap.h | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/src/keymap.h b/src/keymap.h index c15052b..7c5341d 100644 --- a/src/keymap.h +++ b/src/keymap.h @@ -438,6 +438,17 @@ XkbKeyNumLevels(const struct xkb_key *key, xkb_layout_index_t layout) return key->groups[layout].type->num_levels; } +/* + * If the virtual modifiers are not bound to anything, the entry + * is not active and should be skipped. xserver does this with + * cached entry->active field. + */ +static inline bool +entry_is_active(const struct xkb_key_type_entry *entry) +{ + return entry->mods.mods == 0 || entry->mods.mask != 0; +} + struct xkb_keymap * xkb_keymap_new(struct xkb_context *ctx, enum xkb_keymap_format format, |