summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorDaniel Stone <daniel@fooishbar.org>2012-09-11 12:20:21 +0100
committerDaniel Stone <daniel@fooishbar.org>2012-09-11 12:20:21 +0100
commited9fd5beb001c30c7292e9a31d7ebccd4e91a973 (patch)
treeea6aabc0a847f989fbc2cf41195b78add8651b20 /src
parent6573aca0b26b50009f00ccf7673406ee1aa3943c (diff)
downloadlibxkbcommon-ed9fd5beb001c30c7292e9a31d7ebccd4e91a973.tar.gz
libxkbcommon-ed9fd5beb001c30c7292e9a31d7ebccd4e91a973.tar.bz2
libxkbcommon-ed9fd5beb001c30c7292e9a31d7ebccd4e91a973.zip
kbproto unentanglement: control actions
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Diffstat (limited to 'src')
-rw-r--r--src/keymap-dump.c6
-rw-r--r--src/text.c28
-rw-r--r--src/xkb-priv.h23
3 files changed, 37 insertions, 20 deletions
diff --git a/src/keymap-dump.c b/src/keymap-dump.c
index 0c5e49a..bd538b2 100644
--- a/src/keymap-dump.c
+++ b/src/keymap-dump.c
@@ -193,7 +193,7 @@ get_indicator_state_text(uint8_t which)
}
static char *
-get_control_mask_text(uint32_t control_mask)
+get_control_mask_text(enum xkb_action_controls control_mask)
{
int i;
static char ret[GET_TEXT_BUF_SIZE];
@@ -201,13 +201,11 @@ get_control_mask_text(uint32_t control_mask)
memset(ret, 0, GET_TEXT_BUF_SIZE);
- control_mask &= XkbAllBooleanCtrlsMask;
-
if (control_mask == 0) {
strcpy(ret, "none");
return ret;
}
- else if (control_mask == XkbAllBooleanCtrlsMask) {
+ else if (control_mask == CONTROL_ALL) {
strcpy(ret, "all");
return ret;
}
diff --git a/src/text.c b/src/text.c
index 2422e02..e2e1268 100644
--- a/src/text.c
+++ b/src/text.c
@@ -58,20 +58,20 @@ LookupValue(const LookupEntry tab[], unsigned int value)
}
const LookupEntry ctrlMaskNames[] = {
- { "RepeatKeys", XkbRepeatKeysMask },
- { "Repeat", XkbRepeatKeysMask },
- { "AutoRepeat", XkbRepeatKeysMask },
- { "SlowKeys", XkbSlowKeysMask },
- { "BounceKeys", XkbBounceKeysMask },
- { "StickyKeys", XkbStickyKeysMask },
- { "MouseKeys", XkbMouseKeysMask },
- { "MouseKeysAccel", XkbMouseKeysAccelMask },
- { "AccessXKeys", XkbAccessXKeysMask },
- { "AccessXTimeout", XkbAccessXTimeoutMask },
- { "AccessXFeedback", XkbAccessXFeedbackMask },
- { "AudibleBell", XkbAudibleBellMask },
- { "IgnoreGroupLock", XkbIgnoreGroupLockMask },
- { "all", XkbAllBooleanCtrlsMask },
+ { "RepeatKeys", CONTROL_REPEAT },
+ { "Repeat", CONTROL_REPEAT },
+ { "AutoRepeat", CONTROL_REPEAT },
+ { "SlowKeys", CONTROL_SLOW },
+ { "BounceKeys", CONTROL_DEBOUNCE },
+ { "StickyKeys", CONTROL_STICKY },
+ { "MouseKeys", CONTROL_MOUSEKEYS },
+ { "MouseKeysAccel", CONTROL_MOUSEKEYS_ACCEL },
+ { "AccessXKeys", CONTROL_AX },
+ { "AccessXTimeout", CONTROL_AX_TIMEOUT },
+ { "AccessXFeedback", CONTROL_AX_FEEDBACK },
+ { "AudibleBell", CONTROL_BELL },
+ { "IgnoreGroupLock", CONTROL_IGNORE_GROUP_LOCK },
+ { "all", CONTROL_ALL },
{ "none", 0 },
{ "Overlay1", 0 },
{ "Overlay2", 0 },
diff --git a/src/xkb-priv.h b/src/xkb-priv.h
index ae0aef0..3900b84 100644
--- a/src/xkb-priv.h
+++ b/src/xkb-priv.h
@@ -166,6 +166,25 @@ enum xkb_action_flags {
ACTION_SAME_SCREEN = (1 << 9),
};
+enum xkb_action_controls {
+ CONTROL_REPEAT = (1 << 0),
+ CONTROL_SLOW = (1 << 1),
+ CONTROL_DEBOUNCE = (1 << 2),
+ CONTROL_STICKY = (1 << 3),
+ CONTROL_MOUSEKEYS = (1 << 4),
+ CONTROL_MOUSEKEYS_ACCEL = (1 << 5),
+ CONTROL_AX = (1 << 6),
+ CONTROL_AX_TIMEOUT = (1 << 7),
+ CONTROL_AX_FEEDBACK = (1 << 8),
+ CONTROL_BELL = (1 << 9),
+ CONTROL_IGNORE_GROUP_LOCK = (1 << 10),
+ CONTROL_ALL = \
+ (CONTROL_REPEAT | CONTROL_SLOW | CONTROL_DEBOUNCE | CONTROL_STICKY | \
+ CONTROL_MOUSEKEYS | CONTROL_MOUSEKEYS_ACCEL | CONTROL_AX | \
+ CONTROL_AX_TIMEOUT | CONTROL_AX_FEEDBACK | CONTROL_BELL | \
+ CONTROL_IGNORE_GROUP_LOCK)
+};
+
struct xkb_mods {
xkb_mod_mask_t mods; /* original real+virtual mods in definition */
xkb_mod_mask_t mask; /* computed effective mask */
@@ -186,7 +205,7 @@ struct xkb_group_action {
struct xkb_controls_action {
enum xkb_action_type type;
enum xkb_action_flags flags;
- uint32_t ctrls;
+ enum xkb_action_controls ctrls;
};
struct xkb_pointer_default_action {
@@ -274,7 +293,7 @@ struct xkb_indicator_map {
uint32_t groups;
enum xkb_state_component which_mods;
struct xkb_mods mods;
- unsigned int ctrls;
+ enum xkb_action_controls ctrls;
};
struct xkb_key_alias {