summaryrefslogtreecommitdiff
path: root/dix/events.c
diff options
context:
space:
mode:
authorPeter Hutterer <peter@cs.unisa.edu.au>2007-09-06 18:52:02 +0930
committerDaniel Stone <daniel@fooishbar.org>2007-10-28 16:05:04 +0200
commit8d3d027062c105b50863dce43b8070ec560bc12e (patch)
treedcb77807dd5f8d8a159b4f05b7d899eee1503a0f /dix/events.c
parent99e826e867c1c5520153c539ba07a884aec88d0c (diff)
dix: add XI event support to FixKeyState.
FixKeyState needs to be able to handle XI events, otherwise we get "impossible keyboard events" on server zaps and other special key combos. (cherry picked from commit 5ee409794ee604fcf84886f70429fc2d6b1ff4f1)
Diffstat (limited to 'dix/events.c')
-rw-r--r--dix/events.c21
1 files changed, 9 insertions, 12 deletions
diff --git a/dix/events.c b/dix/events.c
index 61dd53417..d454b8f3b 100644
--- a/dix/events.c
+++ b/dix/events.c
@@ -3150,7 +3150,7 @@ drawable.id:0;
#ifdef XKB
/* This function is used to set the key pressed or key released state -
this is only used when the pressing of keys does not cause
- CoreProcessKeyEvent to be called, as in for example Mouse Keys.
+ the device's processInputProc to be called, as in for example Mouse Keys.
*/
void
FixKeyState (xEvent *xE, DeviceIntPtr keybd)
@@ -3163,22 +3163,19 @@ FixKeyState (xEvent *xE, DeviceIntPtr keybd)
kptr = &keyc->down[key >> 3];
bit = 1 << (key & 7);
- if (((xE->u.u.type==KeyPress)||(xE->u.u.type==KeyRelease))) {
+ if (((xE->u.u.type==KeyPress)||(xE->u.u.type==KeyRelease)||
+ (xE->u.u.type==DeviceKeyPress)||(xE->u.u.type==DeviceKeyRelease))
+ ) {
DebugF("FixKeyState: Key %d %s\n",key,
- (xE->u.u.type==KeyPress?"down":"up"));
+ (((xE->u.u.type==KeyPress)||(xE->u.u.type==DeviceKeyPress))?"down":"up"));
}
- switch (xE->u.u.type)
- {
- case KeyPress:
+ if (xE->u.u.type == KeyPress || xE->u.u.type == DeviceKeyPress)
*kptr |= bit;
- break;
- case KeyRelease:
+ else if (xE->u.u.type == KeyRelease || xE->u.u.type == DeviceKeyRelease)
*kptr &= ~bit;
- break;
- default:
- FatalError("Impossible keyboard event");
- }
+ else
+ FatalError("Impossible keyboard event");
}
#endif