aboutsummaryrefslogtreecommitdiff
path: root/xorg-server/Xi
diff options
context:
space:
mode:
authormarha <marha@users.sourceforge.net>2010-07-07 06:21:38 +0000
committermarha <marha@users.sourceforge.net>2010-07-07 06:21:38 +0000
commit5da15e274b35656568f59602f2e3fd00d5718879 (patch)
treefd10e6e7f99de6769eaef050a63de8e2d55d638d /xorg-server/Xi
parent1888d52b15666fb0fe1d47c329d92335e6d9157f (diff)
downloadvcxsrv-5da15e274b35656568f59602f2e3fd00d5718879.tar.gz
vcxsrv-5da15e274b35656568f59602f2e3fd00d5718879.tar.bz2
vcxsrv-5da15e274b35656568f59602f2e3fd00d5718879.zip
git update 7/7/2010
Diffstat (limited to 'xorg-server/Xi')
-rw-r--r--xorg-server/Xi/exevents.c27
1 files changed, 12 insertions, 15 deletions
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])