summaryrefslogtreecommitdiffstats
path: root/contrib
diff options
context:
space:
mode:
authordscho <dscho>2002-12-25 16:02:49 +0000
committerdscho <dscho>2002-12-25 16:02:49 +0000
commit49c2d82dcb0d521c9b8c1605d94deea53e6617d5 (patch)
tree8ead2fbbdcb0bd71c708047a0c47736b0e4ece2b /contrib
parentba2029e998a400f01719cd661a7acc35ae5cc427 (diff)
downloadlibvncserver-49c2d82dcb0d521c9b8c1605d94deea53e6617d5.zip
libvncserver-49c2d82dcb0d521c9b8c1605d94deea53e6617d5.tar.gz
strange, but standard X11 behaviour from Sun keymappings...
Diffstat (limited to 'contrib')
-rw-r--r--contrib/x11vnc.c19
1 files changed, 19 insertions, 0 deletions
diff --git a/contrib/x11vnc.c b/contrib/x11vnc.c
index 4696126..ed7689f 100644
--- a/contrib/x11vnc.c
+++ b/contrib/x11vnc.c
@@ -238,6 +238,25 @@ void initialize_keycodes() {
keymap = XGetKeyboardMapping(dpy, minkey, (maxkey - minkey + 1),
&syms_per_keycode);
+ /* handle alphabetic char with only one keysym (no upper + lower) */
+ for (i = minkey; i <= maxkey; i++) {
+ X_KeySym lower, upper;
+ /* 2nd one */
+ key = keymap[(i - minkey) * syms_per_keycode + 1];
+ if (key != NoSymbol) {
+ continue;
+ }
+ /* 1st one */
+ key = keymap[(i - minkey) * syms_per_keycode + 0];
+ if (key == NoSymbol) {
+ continue;
+ }
+ XConvertCase(key, &lower, &upper);
+ if (lower != upper) {
+ keymap[(i - minkey) * syms_per_keycode + 0] = lower;
+ keymap[(i - minkey) * syms_per_keycode + 1] = upper;
+ }
+ }
for (i = minkey; i <= maxkey; i++) {
for (j = 0; j < syms_per_keycode; j++) {
key = keymap[ (i - minkey) * syms_per_keycode + j ];
OpenPOWER on IntegriCloud