diff options
author | marha <marha@users.sourceforge.net> | 2010-07-07 09:37:20 +0000 |
---|---|---|
committer | marha <marha@users.sourceforge.net> | 2010-07-07 09:37:20 +0000 |
commit | 3dd9390c49402534bc391f621a6b0f497a9407f7 (patch) | |
tree | bc5cd4665a525dbc9550292ad393fa0e5590c4a1 /xorg-server/Xi | |
parent | a31abc5ff6da849ed1ac579a1c905d16ffaafcc7 (diff) | |
parent | 5da15e274b35656568f59602f2e3fd00d5718879 (diff) | |
download | vcxsrv-3dd9390c49402534bc391f621a6b0f497a9407f7.tar.gz vcxsrv-3dd9390c49402534bc391f621a6b0f497a9407f7.tar.bz2 vcxsrv-3dd9390c49402534bc391f621a6b0f497a9407f7.zip |
svn merge ^/branches/released .
Diffstat (limited to 'xorg-server/Xi')
-rw-r--r-- | xorg-server/Xi/exevents.c | 27 |
1 files changed, 12 insertions, 15 deletions
diff --git a/xorg-server/Xi/exevents.c b/xorg-server/Xi/exevents.c index 8e566737a..734d4171c 100644 --- a/xorg-server/Xi/exevents.c +++ b/xorg-server/Xi/exevents.c @@ -749,7 +749,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
@@ -816,32 +815,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])
@@ -861,8 +859,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;
@@ -877,11 +874,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])
|