diff options
Diffstat (limited to 'hw/xnest')
-rw-r--r-- | hw/xnest/Keyboard.c | 21 |
1 files changed, 5 insertions, 16 deletions
diff --git a/hw/xnest/Keyboard.c b/hw/xnest/Keyboard.c index 191bec780..1835c7071 100644 --- a/hw/xnest/Keyboard.c +++ b/hw/xnest/Keyboard.c @@ -206,29 +206,19 @@ LegalModifier(unsigned int key, DeviceIntPtr pDev) void xnestUpdateModifierState(unsigned int state) { -#if 0 DeviceIntPtr pDev = xnestKeyboardDevice; KeyClassPtr keyc = pDev->key; int i; CARD8 mask; + int xkb_state; if (!pDev) return; -/* This is pretty broken. - * - * What should happen is that focus out should do as a VT switch does in - * traditional servers: fake releases for all keys (and buttons too, come - * to think of it) currently down. Then, on focus in, get the state from - * the host, and fake keypresses for everything currently down. - * - * So I'm leaving this broken for a little while. Sorry, folks. - * - * -daniels - */ + xkb_state = XkbStateFieldFromRec(&pDev->key->xkbInfo->state); state = state & 0xff; - if (keyc->state == state) + if (xkb_state == state) return; for (i = 0, mask = 1; i < 8; i++, mask <<= 1) { @@ -236,7 +226,7 @@ xnestUpdateModifierState(unsigned int state) /* Modifier is down, but shouldn't be */ - if ((keyc->state & mask) && !(state & mask)) { + if ((xkb_state & mask) && !(state & mask)) { int count = keyc->modifierKeyCount[i]; for (key = 0; key < MAP_LENGTH; key++) @@ -257,12 +247,11 @@ xnestUpdateModifierState(unsigned int state) /* Modifier shoud be down, but isn't */ - if (!(keyc->state & mask) && (state & mask)) + if (!(xkb_state & mask) && (state & mask)) for (key = 0; key < MAP_LENGTH; key++) if (keyc->xkbInfo->desc->map->modmap[key] & mask) { xnestQueueKeyEvent(KeyPress, key); break; } } -#endif } |