Input: Ignore modifiers in core input processing
Modifiers get cleared by the XKB code when we drop down into core input processing, so just delete the dead code path to simplify things a bit. Signed-off-by: Daniel Stone <daniel@fooishbar.org> Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
This commit is contained in:
parent
6727ee9408
commit
cf6a2fc2bd
|
@ -763,8 +763,6 @@ UpdateDeviceState(DeviceIntPtr device, xEvent* xE, int count)
|
|||
ValuatorClassPtr v = NULL;
|
||||
deviceValuator *xV = (deviceValuator *) xE;
|
||||
BYTE *kptr = NULL;
|
||||
CARD16 modifiers = 0,
|
||||
mask = 0;
|
||||
|
||||
/* 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
|
||||
|
@ -855,7 +853,6 @@ UpdateDeviceState(DeviceIntPtr device, xEvent* xE, int count)
|
|||
if (!k)
|
||||
return DONT_PROCESS;
|
||||
|
||||
modifiers = k->modifierMap[key];
|
||||
kptr = &k->down[key >> 3];
|
||||
if (*kptr & bit) { /* allow ddx to generate multiple downs */
|
||||
return IS_REPEAT;
|
||||
|
@ -863,13 +860,6 @@ UpdateDeviceState(DeviceIntPtr device, xEvent* xE, int count)
|
|||
if (device->valuator)
|
||||
device->valuator->motionHintWindow = NullWindow;
|
||||
*kptr |= bit;
|
||||
for (i = 0, mask = 1; modifiers; i++, mask <<= 1) {
|
||||
if (mask & modifiers) {
|
||||
/* This key affects modifier "i" */
|
||||
k->modifierKeyCount[i]++;
|
||||
modifiers &= ~mask;
|
||||
}
|
||||
}
|
||||
} else if (xE->u.u.type == DeviceKeyRelease) {
|
||||
if (!k)
|
||||
return DONT_PROCESS;
|
||||
|
@ -877,19 +867,9 @@ UpdateDeviceState(DeviceIntPtr device, xEvent* xE, int count)
|
|||
kptr = &k->down[key >> 3];
|
||||
if (!(*kptr & bit)) /* guard against duplicates */
|
||||
return DONT_PROCESS;
|
||||
modifiers = k->modifierMap[key];
|
||||
if (device->valuator)
|
||||
device->valuator->motionHintWindow = NullWindow;
|
||||
*kptr &= ~bit;
|
||||
for (i = 0, mask = 1; modifiers; i++, mask <<= 1) {
|
||||
if (mask & modifiers) {
|
||||
/* This key affects modifier "i" */
|
||||
if (--k->modifierKeyCount[i] <= 0) {
|
||||
k->modifierKeyCount[i] = 0;
|
||||
}
|
||||
modifiers &= ~mask;
|
||||
}
|
||||
}
|
||||
} else if (xE->u.u.type == DeviceButtonPress) {
|
||||
if (!b)
|
||||
return DONT_PROCESS;
|
||||
|
|
|
@ -3663,7 +3663,6 @@ CoreProcessKeyboardEvent (xEvent *xE, DeviceIntPtr keybd, int count)
|
|||
{
|
||||
int key, bit;
|
||||
BYTE *kptr;
|
||||
CARD8 modifiers;
|
||||
GrabPtr grab;
|
||||
GrabInfoPtr grabinfo;
|
||||
Bool deactivateGrab = FALSE;
|
||||
|
@ -3694,7 +3693,6 @@ CoreProcessKeyboardEvent (xEvent *xE, DeviceIntPtr keybd, int count)
|
|||
key = xE->u.u.detail;
|
||||
kptr = &keyc->down[key >> 3];
|
||||
bit = 1 << (key & 7);
|
||||
modifiers = keyc->modifierMap[key];
|
||||
|
||||
switch (xE->u.u.type)
|
||||
{
|
||||
|
|
|
@ -798,7 +798,6 @@ _XkbFilterRedirectKey( XkbSrvInfoPtr xkbi,
|
|||
unsigned keycode,
|
||||
XkbAction * pAction)
|
||||
{
|
||||
unsigned realMods = 0;
|
||||
xEvent ev;
|
||||
int x,y;
|
||||
XkbStateRec old;
|
||||
|
@ -852,13 +851,10 @@ ProcessInputProc backupproc;
|
|||
XkbComputeDerivedState(xkbi);
|
||||
}
|
||||
|
||||
realMods = xkbi->device->key->modifierMap[ev.u.u.detail];
|
||||
xkbi->device->key->modifierMap[ev.u.u.detail] = 0;
|
||||
UNWRAP_PROCESS_INPUT_PROC(xkbi->device,xkbPrivPtr, backupproc);
|
||||
xkbi->device->public.processInputProc(&ev,xkbi->device,1);
|
||||
COND_WRAP_PROCESS_INPUT_PROC(xkbi->device, xkbPrivPtr,
|
||||
backupproc,xkbUnwrapProc);
|
||||
xkbi->device->key->modifierMap[ev.u.u.detail] = realMods;
|
||||
|
||||
if ( mask || mods )
|
||||
xkbi->state= old;
|
||||
|
@ -887,13 +883,10 @@ ProcessInputProc backupproc;
|
|||
XkbComputeDerivedState(xkbi);
|
||||
}
|
||||
|
||||
realMods = xkbi->device->key->modifierMap[ev.u.u.detail];
|
||||
xkbi->device->key->modifierMap[ev.u.u.detail] = 0;
|
||||
UNWRAP_PROCESS_INPUT_PROC(xkbi->device,xkbPrivPtr, backupproc);
|
||||
xkbi->device->public.processInputProc(&ev,xkbi->device,1);
|
||||
COND_WRAP_PROCESS_INPUT_PROC(xkbi->device, xkbPrivPtr,
|
||||
backupproc,xkbUnwrapProc);
|
||||
xkbi->device->key->modifierMap[ev.u.u.detail] = realMods;
|
||||
|
||||
if ( mask || mods )
|
||||
xkbi->state= old;
|
||||
|
@ -1078,7 +1071,6 @@ void
|
|||
XkbHandleActions(DeviceIntPtr dev,DeviceIntPtr kbd,xEvent *xE,int count)
|
||||
{
|
||||
int key,bit,i;
|
||||
CARD8 realMods = 0;
|
||||
XkbSrvInfoPtr xkbi;
|
||||
KeyClassPtr keyc;
|
||||
int changed,sendEvent;
|
||||
|
@ -1216,19 +1208,15 @@ xkbDeviceInfoPtr xkbPrivPtr = XKBDEVICEINFO(dev);
|
|||
|
||||
if (sendEvent) {
|
||||
DeviceIntPtr tmpdev;
|
||||
if (keyEvent) {
|
||||
realMods = keyc->modifierMap[key];
|
||||
keyc->modifierMap[key] = 0;
|
||||
if (keyEvent)
|
||||
tmpdev = dev;
|
||||
} else
|
||||
else
|
||||
tmpdev = GetPairedDevice(dev);
|
||||
|
||||
UNWRAP_PROCESS_INPUT_PROC(tmpdev,xkbPrivPtr, backupproc);
|
||||
dev->public.processInputProc(xE,tmpdev,count);
|
||||
COND_WRAP_PROCESS_INPUT_PROC(tmpdev, xkbPrivPtr,
|
||||
backupproc,xkbUnwrapProc);
|
||||
if (keyEvent)
|
||||
keyc->modifierMap[key] = realMods;
|
||||
}
|
||||
else if (keyEvent) {
|
||||
FixKeyState(xE,dev);
|
||||
|
|
Loading…
Reference in New Issue
Block a user