From 5da15e274b35656568f59602f2e3fd00d5718879 Mon Sep 17 00:00:00 2001 From: marha Date: Wed, 7 Jul 2010 06:21:38 +0000 Subject: git update 7/7/2010 --- xorg-server/Xi/exevents.c | 27 ++++++++++++--------------- 1 file changed, 12 insertions(+), 15 deletions(-) (limited to 'xorg-server/Xi') diff --git a/xorg-server/Xi/exevents.c b/xorg-server/Xi/exevents.c index d1d87a639..0bc2ecc81 100644 --- a/xorg-server/Xi/exevents.c +++ b/xorg-server/Xi/exevents.c @@ -747,7 +747,6 @@ UpdateDeviceState(DeviceIntPtr device, DeviceEvent* event) KeyClassPtr k = NULL; ButtonClassPtr b = NULL; ValuatorClassPtr v = NULL; - BYTE *kptr = NULL; /* This event is always the first we get, before the actual events with * the data. However, the way how the DDX is set up, "device" will @@ -814,32 +813,31 @@ 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) return DONT_PROCESS; - kptr = &b->down[key >> 3]; - if ((*kptr & bit) != 0) + if (button_is_down(device, key, BUTTON_PROCESSED)) return DONT_PROCESS; - *kptr |= bit; + + set_button_down(device, key, BUTTON_PROCESSED); if (device->valuator) device->valuator->motionHintWindow = NullWindow; if (!b->map[key]) @@ -859,8 +857,7 @@ UpdateDeviceState(DeviceIntPtr device, DeviceEvent* event) if (!b) return DONT_PROCESS; - kptr = &b->down[key>>3]; - if (!(*kptr & bit)) + if (!button_is_down(device, key, BUTTON_PROCESSED)) return DONT_PROCESS; if (IsMaster(device)) { DeviceIntPtr sd; @@ -875,11 +872,11 @@ UpdateDeviceState(DeviceIntPtr device, DeviceEvent* event) continue; if (!sd->button) continue; - if ((sd->button->down[key>>3] & bit) != 0) + if (button_is_down(sd, key, BUTTON_PROCESSED)) return DONT_PROCESS; } } - *kptr &= ~bit; + set_button_up(device, key, BUTTON_PROCESSED); if (device->valuator) device->valuator->motionHintWindow = NullWindow; if (!b->map[key]) -- cgit v1.2.3