1 diff -up tigervnc-1.0.90-20100420svn4030/unix/xserver/hw/vnc/Input.cc.rh611677 tigervnc-1.0.90-20100420svn4030/unix/xserver/hw/vnc/Input.cc
2 --- tigervnc-1.0.90-20100420svn4030/unix/xserver/hw/vnc/Input.cc.rh611677 2010-08-24 17:40:00.511860227 +0200
3 +++ tigervnc-1.0.90-20100420svn4030/unix/xserver/hw/vnc/Input.cc 2010-08-24 17:49:23.169007409 +0200
4 @@ -322,6 +322,11 @@ public:
8 + if (maxKeysPerMod == 0) {
9 + vlog.debug("Keyboard has no modifiers");
13 keycode = modmap[modIndex * maxKeysPerMod];
16 @@ -355,6 +360,11 @@ public:
17 vlog.error("generate_modkeymap failed");
21 + if (maxKeysPerMod == 0) {
22 + vlog.debug("Keyboard has no modifiers");
26 maxKeysPerMod = keyc->maxKeysPerModifier;
28 @@ -530,6 +540,9 @@ void InputDevice::keyEvent(rdr::U32 keys
32 + if (maxKeysPerMod == 0)
33 + vlog.debug("Keyboard has no modifiers");
35 state = XkbStateFieldFromRec(&keyc->xkbInfo->state);
37 keyc = keyboardDev->key;
38 @@ -565,11 +578,13 @@ void InputDevice::keyEvent(rdr::U32 keys
42 - if ((state & (1 << ShiftMapIndex)) != 0)
44 - if (modeSwitchMapIndex != 0 &&
45 - ((state & (1 << modeSwitchMapIndex))) != 0)
47 + if (maxKeysPerMod != 0) {
48 + if ((state & (1 << ShiftMapIndex)) != 0)
50 + if (modeSwitchMapIndex != 0 &&
51 + ((state & (1 << modeSwitchMapIndex))) != 0)
55 int kc = KeysymToKeycode(keymap, keysym, &col);
57 @@ -581,7 +596,8 @@ ModeSwitchFound:
58 * We never get ISO_Left_Tab here because it's already been translated
59 * in VNCSConnectionST.
61 - if (keysym == XK_Tab && ((state & (1 << ShiftMapIndex))) != 0)
62 + if (maxKeysPerMod != 0 && keysym == XK_Tab &&
63 + ((state & (1 << ShiftMapIndex))) != 0)
67 @@ -662,18 +678,20 @@ ModeSwitchFound:
71 - ModifierState shift(keyboardDev, ShiftMapIndex);
72 - ModifierState modeSwitch(keyboardDev, modeSwitchMapIndex);
78 - if (modeSwitchMapIndex) {
81 + if (maxKeysPerMod != 0) {
82 + ModifierState shift(keyboardDev, ShiftMapIndex);
83 + ModifierState modeSwitch(keyboardDev, modeSwitchMapIndex);
88 - modeSwitch.release();
90 + if (modeSwitchMapIndex) {
94 + modeSwitch.release();