symbols: remove support for key behaviors The possible key behaviors are: KB_RadioGroup, KB_Overlay1, KB_Overlay2: already removed support for these. KB_Lock (with or without KB_Permanent): used to ignore key presses or releases to simulate and deal with some legacy keyboard behaviors (like keys that physically lock). Not used at all. We already ignore them while processing key events in state.c, so make it official. Signed-off-by: Ran Benita <ran234@gmail.com>
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173
diff --git a/README b/README
index 2089b38..5f2d57c 100644
--- a/README
+++ b/README
@@ -79,6 +79,9 @@ Notable removals:
+ completely unused in current keymaps, never fully implemented
- overlays
+ almost completely unused in current keymaps
+ - key behaviors
+ + used to implement radio groups and overlays, and to deal with things
+ like keys that physically lock; unused in current keymaps
- indicator behaviours such as LED-controls-key
+ the only supported LED behaviour is key-controls-LED; again this
was never really used in current keymaps
diff --git a/src/xkb-priv.h b/src/xkb-priv.h
index f570665..e4f99d2 100644
--- a/src/xkb-priv.h
+++ b/src/xkb-priv.h
@@ -265,11 +265,6 @@ struct xkb_sym_interpret {
union xkb_action act;
};
-struct xkb_behavior {
- unsigned char type;
- unsigned char data;
-};
-
struct xkb_indicator_map {
unsigned char flags;
unsigned char which_groups;
@@ -308,8 +303,6 @@ struct xkb_key {
unsigned char modmap;
xkb_mod_mask_t vmodmap;
- struct xkb_behavior behavior;
-
bool repeats;
/* Index into keymap->acts */
diff --git a/src/xkbcomp/compat.c b/src/xkbcomp/compat.c
index 662b6c1..2761221 100644
--- a/src/xkbcomp/compat.c
+++ b/src/xkbcomp/compat.c
@@ -1440,9 +1440,6 @@ ApplyInterpsToKey(struct xkb_keymap *keymap, struct xkb_key *key)
if (!(key->explicit & XkbExplicitAutoRepeatMask) &&
(!interp || (interp->flags & XkbSI_AutoRepeat)))
key->repeats = true;
- if (!(key->explicit & XkbExplicitBehaviorMask) &&
- interp && (interp->flags & XkbSI_LockingKey))
- key->behavior.type = XkbKB_Lock;
}
if (!interp)
diff --git a/src/xkbcomp/symbols.c b/src/xkbcomp/symbols.c
index cda40d4..3a56082 100644
--- a/src/xkbcomp/symbols.c
+++ b/src/xkbcomp/symbols.c
@@ -45,11 +45,10 @@ enum key_field {
KEY_FIELD_SYMS = (1 << 0),
KEY_FIELD_ACTS = (1 << 1),
KEY_FIELD_REPEAT = (1 << 2),
- KEY_FIELD_BEHAVIOR = (1 << 3),
- KEY_FIELD_TYPE_DFLT = (1 << 4),
- KEY_FIELD_TYPES = (1 << 5),
- KEY_FIELD_GROUPINFO = (1 << 6),
- KEY_FIELD_VMODMAP = (1 << 7),
+ KEY_FIELD_TYPE_DFLT = (1 << 3),
+ KEY_FIELD_TYPES = (1 << 4),
+ KEY_FIELD_GROUPINFO = (1 << 5),
+ KEY_FIELD_VMODMAP = (1 << 6),
};
typedef struct _KeyInfo {
@@ -82,7 +81,6 @@ typedef struct _KeyInfo {
xkb_atom_t types[XkbNumKbdGroups];
enum key_repeat repeat;
- struct xkb_behavior behavior;
unsigned short vmodmap;
xkb_atom_t dfltType;
@@ -115,8 +113,6 @@ InitKeyInfo(KeyInfo *keyi, unsigned file_id)
}
keyi->dfltType = XKB_ATOM_NONE;
- keyi->behavior.type = XkbKB_Default;
- keyi->behavior.data = 0;
keyi->vmodmap = 0;
keyi->repeat = KEY_REPEAT_UNDEFINED;
keyi->out_of_range_group_action = 0;
@@ -581,10 +577,6 @@ MergeKeys(SymbolsInfo *info, KeyInfo *into, KeyInfo *from)
}
}
- if (UseNewKeyField(KEY_FIELD_BEHAVIOR, into, from, verbosity, &collide)) {
- into->behavior = from->behavior;
- into->defined |= KEY_FIELD_BEHAVIOR;
- }
if (UseNewKeyField(KEY_FIELD_VMODMAP, into, from, verbosity, &collide)) {
into->vmodmap = from->vmodmap;
into->defined |= KEY_FIELD_VMODMAP;
@@ -993,17 +985,6 @@ AddActionsToKey(SymbolsInfo *info, KeyInfo *keyi, ExprDef *arrayNdx,
return true;
}
-static const LookupEntry lockingEntries[] = {
- { "true", XkbKB_Lock },
- { "yes", XkbKB_Lock },
- { "on", XkbKB_Lock },
- { "false", XkbKB_Default },
- { "no", XkbKB_Default },
- { "off", XkbKB_Default },
- { "permanent", XkbKB_Lock | XkbKB_Permanent },
- { NULL, 0 }
-};
-
static const LookupEntry repeatEntries[] = {
{ "true", KEY_REPEAT_YES },
{ "yes", KEY_REPEAT_YES },
@@ -1072,12 +1053,10 @@ SetSymbolsField(SymbolsInfo *info, KeyInfo *keyi, const char *field,
else if (istreq(field, "locking") ||
istreq(field, "lock") ||
istreq(field, "locks")) {
- unsigned int val;
-
- ok = ExprResolveEnum(ctx, value, &val, lockingEntries);
- if (ok)
- keyi->behavior.type = val;
- keyi->defined |= KEY_FIELD_BEHAVIOR;
+ log_err(info->keymap->ctx,
+ "Key behaviors not supported; "
+ "Ignoring locking specification for key %s\n",
+ LongKeyNameText(keyi->name));
}
else if (istreq(field, "radiogroup") ||
istreq(field, "permanentradiogroup") ||
@@ -1086,7 +1065,6 @@ SetSymbolsField(SymbolsInfo *info, KeyInfo *keyi, const char *field,
"Radio groups not supported; "
"Ignoring radio group specification for key %s\n",
LongKeyNameText(keyi->name));
- return false;
}
else if (istreq_prefix("overlay", field) ||
istreq_prefix("permanentoverlay", field)) {
@@ -1172,6 +1150,7 @@ SetSymbolsField(SymbolsInfo *info, KeyInfo *keyi, const char *field,
field);
ok = false;
}
+
return ok;
}
@@ -1850,19 +1829,12 @@ CopySymbolsDef(SymbolsInfo *info, KeyInfo *keyi,
}
}
}
- switch (keyi->behavior.type & XkbKB_OpMask) {
- case XkbKB_Default:
- break;
- default:
- key->behavior = keyi->behavior;
- key->explicit |= XkbExplicitBehaviorMask;
- break;
- }
if (keyi->defined & KEY_FIELD_VMODMAP) {
key->vmodmap = keyi->vmodmap;
key->explicit |= XkbExplicitVModMapMask;
}
+
if (keyi->repeat != KEY_REPEAT_UNDEFINED) {
key->repeats = (keyi->repeat == KEY_REPEAT_YES);
key->explicit |= XkbExplicitAutoRepeatMask;