mirror of
https://gitlab.freedesktop.org/xorg/xserver.git
synced 2026-04-19 17:10:42 +02:00
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 commit5ee409794e) (cherry picked from commit8d3d027062)
This commit is contained in:
parent
15117d47bf
commit
600752bece
1 changed files with 9 additions and 12 deletions
21
dix/events.c
21
dix/events.c
|
|
@ -3095,7 +3095,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)
|
||||
|
|
@ -3108,22 +3108,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
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue