diff options
author | Daniel Stone <daniel@fooishbar.org> | 2008-04-17 12:42:01 -0700 |
---|---|---|
committer | Daniel Stone <daniel@fooishbar.org> | 2009-01-22 15:08:55 +1100 |
commit | 32db27a7f867b503c2840ca7b815e96d10be9210 (patch) | |
tree | e92648cdf253abecbd8dd5491fc1678c5464d8c9 /hw/xnest/Keyboard.c | |
parent | f062e90a95f9b7ae5458ef2100615e8ace9b66a7 (diff) |
Input: Remove modifierMap from core
We already have modmap (in the exact same format!) in XKB, so just use
that all the time, instead of duplicating the information.
Signed-off-by: Daniel Stone <daniel@fooishbar.org>
Signed-off-by: Peter Hutterer <peter.hutterer@who-t.net>
Diffstat (limited to 'hw/xnest/Keyboard.c')
-rw-r--r-- | hw/xnest/Keyboard.c | 22 |
1 files changed, 4 insertions, 18 deletions
diff --git a/hw/xnest/Keyboard.c b/hw/xnest/Keyboard.c index 35be5212e..022816dec 100644 --- a/hw/xnest/Keyboard.c +++ b/hw/xnest/Keyboard.c @@ -119,7 +119,6 @@ xnestKeyboardProc(DeviceIntPtr pDev, int onoff) int mapWidth; int min_keycode, max_keycode; KeySymsRec keySyms; - CARD8 modmap[MAP_LENGTH]; int i, j; XKeyboardState values; XkbComponentNamesRec names; @@ -130,7 +129,6 @@ xnestKeyboardProc(DeviceIntPtr pDev, int onoff) switch (onoff) { case DEVICE_INIT: - modifier_keymap = XGetModifierMapping(xnestDisplay); XDisplayKeycodes(xnestDisplay, &min_keycode, &max_keycode); #ifdef _XSERVER64 { @@ -153,18 +151,6 @@ xnestKeyboardProc(DeviceIntPtr pDev, int onoff) &mapWidth); #endif - for (i = 0; i < MAP_LENGTH; i++) - modmap[i] = 0; - for (j = 0; j < 8; j++) - for(i = 0; i < modifier_keymap->max_keypermod; i++) { - CARD8 keycode; - if ((keycode = - modifier_keymap-> - modifiermap[j * modifier_keymap->max_keypermod + i])) - modmap[keycode] |= 1<<j; - } - XFreeModifiermap(modifier_keymap); - keySyms.minKeyCode = min_keycode; keySyms.maxKeyCode = max_keycode; keySyms.mapWidth = mapWidth; @@ -189,8 +175,8 @@ xnestKeyboardProc(DeviceIntPtr pDev, int onoff) options = XKB_DFLT_OPTIONS; XkbSetRulesDflts(rules, model, layout, variants, options); - XkbInitKeyboardDeviceStruct(pDev, &names, &keySyms, modmap, - xnestBell, xnestChangeKeyboardControl); + XkbInitKeyboardDeviceStruct(pDev, &names, &keySyms, + xnestBell, xnestChangeKeyboardControl); XkbDDXChangeControls(pDev, xkb->ctrls, xkb->ctrls); XkbFreeKeyboard(xkb, 0, False); xfree(keymap); @@ -250,7 +236,7 @@ xnestUpdateModifierState(unsigned int state) int count = keyc->modifierKeyCount[i]; for (key = 0; key < MAP_LENGTH; key++) - if (keyc->modifierMap[key] & mask) { + if (keyc->xkbInfo->desc->map->modmap[key] & mask) { int bit; BYTE *kptr; @@ -269,7 +255,7 @@ xnestUpdateModifierState(unsigned int state) */ if (!(keyc->state & mask) && (state & mask)) for (key = 0; key < MAP_LENGTH; key++) - if (keyc->modifierMap[key] & mask) { + if (keyc->xkbInfo->desc->map->modmap[key] & mask) { xnestQueueKeyEvent(KeyPress, key); break; } |