summaryrefslogtreecommitdiff
path: root/hw/xnest/Keyboard.c
diff options
context:
space:
mode:
authorAdam Jackson <ajax@nwnk.net>2005-07-02 17:02:23 +0000
committerAdam Jackson <ajax@nwnk.net>2005-07-02 17:02:23 +0000
commite6602b041fe489d51a1d7fac55cbbb12b1826ba1 (patch)
treecc67633841e6231cc9988ddc186c17f9be7257ac /hw/xnest/Keyboard.c
parent9b1debcdb6c7df956c06350a6525afb8e6d691fa (diff)
Bug #3546: Use MAP_LENGTH instead of a magic number. (Mark McLoughlin) Bug
#3664: Further fixes to Xnest modifier state handling. (Mark McLoughlin)
Diffstat (limited to 'hw/xnest/Keyboard.c')
-rw-r--r--hw/xnest/Keyboard.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/hw/xnest/Keyboard.c b/hw/xnest/Keyboard.c
index c63b080ed..903750346 100644
--- a/hw/xnest/Keyboard.c
+++ b/hw/xnest/Keyboard.c
@@ -138,7 +138,7 @@ xnestKeyboardProc(DeviceIntPtr pDev, int onoff)
int mapWidth;
int min_keycode, max_keycode;
KeySymsRec keySyms;
- CARD8 modmap[256];
+ CARD8 modmap[MAP_LENGTH];
int i, j;
XKeyboardState values;
@@ -168,7 +168,7 @@ xnestKeyboardProc(DeviceIntPtr pDev, int onoff)
&mapWidth);
#endif
- for (i = 0; i < 256; i++)
+ 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++) {
@@ -294,6 +294,8 @@ xnestUpdateModifierState(unsigned int state)
int i;
CARD8 mask;
+ state = state & 0xff;
+
if (keyc->state == state)
return;