]>
Commit | Line | Data |
---|---|---|
13a33bd9 JR |
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: | |
5 | return; | |
6 | } | |
7 | ||
8 | + if (maxKeysPerMod == 0) { | |
9 | + vlog.debug("Keyboard has no modifiers"); | |
10 | + return; | |
11 | + } | |
12 | + | |
13 | keycode = modmap[modIndex * maxKeysPerMod]; | |
14 | xfree(modmap); | |
15 | #else | |
16 | @@ -355,6 +360,11 @@ public: | |
17 | vlog.error("generate_modkeymap failed"); | |
18 | return; | |
19 | } | |
20 | + | |
21 | + if (maxKeysPerMod == 0) { | |
22 | + vlog.debug("Keyboard has no modifiers"); | |
23 | + return; | |
24 | + } | |
25 | #else | |
26 | maxKeysPerMod = keyc->maxKeysPerModifier; | |
27 | #endif | |
28 | @@ -530,6 +540,9 @@ void InputDevice::keyEvent(rdr::U32 keys | |
29 | return; | |
30 | } | |
31 | ||
32 | + if (maxKeysPerMod == 0) | |
33 | + vlog.debug("Keyboard has no modifiers"); | |
34 | + | |
35 | state = XkbStateFieldFromRec(&keyc->xkbInfo->state); | |
36 | #else | |
37 | keyc = keyboardDev->key; | |
38 | @@ -565,11 +578,13 @@ void InputDevice::keyEvent(rdr::U32 keys | |
39 | ModeSwitchFound: | |
40 | ||
41 | int col = 0; | |
42 | - if ((state & (1 << ShiftMapIndex)) != 0) | |
43 | - col |= 1; | |
44 | - if (modeSwitchMapIndex != 0 && | |
45 | - ((state & (1 << modeSwitchMapIndex))) != 0) | |
46 | - col |= 2; | |
47 | + if (maxKeysPerMod != 0) { | |
48 | + if ((state & (1 << ShiftMapIndex)) != 0) | |
49 | + col |= 1; | |
50 | + if (modeSwitchMapIndex != 0 && | |
51 | + ((state & (1 << modeSwitchMapIndex))) != 0) | |
52 | + col |= 2; | |
53 | + } | |
54 | ||
55 | int kc = KeysymToKeycode(keymap, keysym, &col); | |
56 | ||
57 | @@ -581,7 +596,8 @@ ModeSwitchFound: | |
58 | * We never get ISO_Left_Tab here because it's already been translated | |
59 | * in VNCSConnectionST. | |
60 | */ | |
61 | - if (keysym == XK_Tab && ((state & (1 << ShiftMapIndex))) != 0) | |
62 | + if (maxKeysPerMod != 0 && keysym == XK_Tab && | |
63 | + ((state & (1 << ShiftMapIndex))) != 0) | |
64 | col |= 1; | |
65 | ||
66 | if (kc == 0) { | |
67 | @@ -662,18 +678,20 @@ ModeSwitchFound: | |
68 | } | |
69 | } | |
70 | ||
71 | - ModifierState shift(keyboardDev, ShiftMapIndex); | |
72 | - ModifierState modeSwitch(keyboardDev, modeSwitchMapIndex); | |
73 | - if (down) { | |
74 | - if (col & 1) | |
75 | - shift.press(); | |
76 | - else | |
77 | - shift.release(); | |
78 | - if (modeSwitchMapIndex) { | |
79 | - if (col & 2) | |
80 | - modeSwitch.press(); | |
81 | + if (maxKeysPerMod != 0) { | |
82 | + ModifierState shift(keyboardDev, ShiftMapIndex); | |
83 | + ModifierState modeSwitch(keyboardDev, modeSwitchMapIndex); | |
84 | + if (down) { | |
85 | + if (col & 1) | |
86 | + shift.press(); | |
87 | else | |
88 | - modeSwitch.release(); | |
89 | + shift.release(); | |
90 | + if (modeSwitchMapIndex) { | |
91 | + if (col & 2) | |
92 | + modeSwitch.press(); | |
93 | + else | |
94 | + modeSwitch.release(); | |
95 | + } | |
96 | } | |
97 | } | |
98 |