summaryrefslogtreecommitdiff
path: root/Xi
diff options
context:
space:
mode:
authorPeter Hutterer <peter.hutterer@who-t.net>2010-07-05 16:47:57 +1000
committerPeter Hutterer <peter.hutterer@who-t.net>2010-07-07 13:29:45 +1000
commitc18442908080c9833dfd6bb2ff367945d1892421 (patch)
treeeccbe0ff3d155d58a8344b9d75609319b1416784 /Xi
parent10442ce02b5be7f82b373bee1939e2b523e291d9 (diff)
Xi: use set_key_up/down instead of manual bit handling.
We have the wrappers, use them. Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'Xi')
-rw-r--r--Xi/exevents.c13
1 files changed, 6 insertions, 7 deletions
diff --git a/Xi/exevents.c b/Xi/exevents.c
index de24b4cc1..df13190a8 100644
--- a/Xi/exevents.c
+++ b/Xi/exevents.c
@@ -814,23 +814,22 @@ UpdateDeviceState(DeviceIntPtr device, DeviceEvent* event)
if (!k)
return DONT_PROCESS;
- kptr = &k->down[key >> 3];
- /* don't allow ddx to generate multiple downs, but repeats are okay */
- if ((*kptr & bit) && !event->key_repeat)
+ /* don't allow ddx to generate multiple downs, but repeats are okay */
+ if (key_is_down(device, key, KEY_PROCESSED) && !event->key_repeat)
return DONT_PROCESS;
+
if (device->valuator)
device->valuator->motionHintWindow = NullWindow;
- *kptr |= bit;
+ set_key_down(device, key, KEY_PROCESSED);
} else if (event->type == ET_KeyRelease) {
if (!k)
return DONT_PROCESS;
- kptr = &k->down[key >> 3];
- if (!(*kptr & bit)) /* guard against duplicates */
+ if (!key_is_down(device, key, KEY_PROCESSED)) /* guard against duplicates */
return DONT_PROCESS;
if (device->valuator)
device->valuator->motionHintWindow = NullWindow;
- *kptr &= ~bit;
+ set_key_up(device, key, KEY_PROCESSED);
} else if (event->type == ET_ButtonPress) {
Mask mask;
if (!b)