write_buf(buf, "\t\tkey %6s {", KeyNameText(key->name));
- if (key->explicit & XkbExplicitKeyTypesMask) {
+ if (key->explicit_groups) {
bool multi_type = false;
struct xkb_key_type *type = XkbKeyType(keymap, key, 0);
if (multi_type) {
for (group = 0; group < key->num_groups; group++) {
- if (!(key->explicit & (1 << group)))
+ if (!(key->explicit_groups & (1 << group)))
continue;
type = XkbKeyType(keymap, key, group);
write_buf(buf, "\n\t\t\ttype[group%u]= \"%s\",",
}
}
- if (key->explicit & XkbExplicitAutoRepeatMask) {
+ if (key->explicit & EXPLICIT_REPEAT) {
if (key->repeats)
write_buf(buf, "\n\t\t\trepeat= Yes,");
else
simple = false;
}
- if (key->vmodmap && (key->explicit & XkbExplicitVModMapMask)) {
+ if (key->vmodmap && (key->explicit & EXPLICIT_VMODMAP)) {
/* XXX: vmodmap cmask? */
write_buf(buf, "\n\t\t\tvirtualMods= %s,",
VModMaskText(keymap, key->vmodmap << XKB_NUM_CORE_MODS));
break;
}
- if (key->explicit & XkbExplicitInterpretMask)
+ if (key->explicit & EXPLICIT_INTERP)
showActions = (key->actions != NULL);
else
showActions = false;
RANGE_REDIRECT,
};
+enum xkb_explicit_components {
+ EXPLICIT_INTERP = (1 << 0),
+ EXPLICIT_VMODMAP = (1 << 1),
+ EXPLICIT_REPEAT = (1 << 2),
+};
+
struct xkb_key {
char name[XKB_KEY_NAME_LENGTH];
- unsigned char explicit;
+ enum xkb_explicit_components explicit;
+ xkb_group_mask_t explicit_groups;
unsigned char modmap;
xkb_mod_mask_t vmodmap;
xkb_level_index_t width, level;
/* If we've been told not to bind interps to this key, then don't. */
- if (key->explicit & XkbExplicitInterpretMask)
+ if (key->explicit & EXPLICIT_INTERP)
return true;
for (group = 0; group < key->num_groups; group++) {
/* Infer default key behaviours from the base level. */
if (group == 0 && level == 0) {
- if (!(key->explicit & XkbExplicitAutoRepeatMask) &&
+ if (!(key->explicit & EXPLICIT_REPEAT) &&
(!interp || interp->repeat))
key->repeats = true;
}
}
}
- if (!(key->explicit & XkbExplicitVModMapMask))
+ if (!(key->explicit & EXPLICIT_VMODMAP))
key->vmodmap = vmodmask;
return true;
}
if (FindNamedType(keymap, keyi->types[i], &types[i])) {
if (!autoType || keyi->numLevels[i] > 2)
- key->explicit |= (1 << i);
+ key->explicit_groups |= (1 << i);
}
else {
log_vrb(info->keymap->ctx, 3,
if (haveActions) {
key->actions = calloc(nGroups * width, sizeof(*key->actions));
- key->explicit |= XkbExplicitInterpretMask;
+ key->explicit |= EXPLICIT_INTERP;
}
key->out_of_range_group_number = keyi->out_of_range_group_number;
if (keyi->defined & KEY_FIELD_VMODMAP) {
key->vmodmap = keyi->vmodmap;
- key->explicit |= XkbExplicitVModMapMask;
+ key->explicit |= EXPLICIT_VMODMAP;
}
if (keyi->repeat != KEY_REPEAT_UNDEFINED) {
key->repeats = (keyi->repeat == KEY_REPEAT_YES);
- key->explicit |= XkbExplicitAutoRepeatMask;
+ key->explicit |= EXPLICIT_REPEAT;
}
/* do the same thing for the next key */
typedef uint32_t xkb_mod_index_t;
typedef uint32_t xkb_mod_mask_t;
typedef uint32_t xkb_group_index_t;
+typedef uint32_t xkb_group_mask_t;
typedef uint32_t xkb_led_index_t;
#define XKB_MOD_INVALID (0xffffffff)