summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2013-05-23 11:45:18 +0000
committerPierre Ossman <ossman@cendio.se>2013-05-23 11:45:18 +0000
commit06c20e55624d74fe893235d45814324ef9f084b4 (patch)
tree7aac9d636bb55d690f94b64adbccfab79c8b377d
parent95eb36bfa9b664b9d50c9dfdb49db4aa0a3fb913 (diff)
downloadtigervnc-06c20e55624d74fe893235d45814324ef9f084b4.tar.gz
tigervnc-06c20e55624d74fe893235d45814324ef9f084b4.zip
xkbcomp ignores keycodes without names, so make sure any keycode
we use actually has one. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@5108 3789f03b-4d11-0410-bbf8-ca57d06f2519
-rw-r--r--unix/xserver/hw/vnc/InputXKB.cc16
1 files changed, 16 insertions, 0 deletions
diff --git a/unix/xserver/hw/vnc/InputXKB.cc b/unix/xserver/hw/vnc/InputXKB.cc
index eadae269..a9796e06 100644
--- a/unix/xserver/hw/vnc/InputXKB.cc
+++ b/unix/xserver/hw/vnc/InputXKB.cc
@@ -501,6 +501,22 @@ KeyCode InputDevice::addKeysym(KeySym keysym, unsigned state)
XkbSetCauseUnknown(&cause);
+ /*
+ * Tools like xkbcomp get confused if there isn't a name
+ * assigned to the keycode we're trying to use.
+ */
+ if (xkb->names && xkb->names->keys &&
+ (xkb->names->keys[key].name[0] == '\0')) {
+ xkb->names->keys[key].name[0] = 'I';
+ xkb->names->keys[key].name[1] = '0' + (key / 100) % 10;
+ xkb->names->keys[key].name[2] = '0' + (key / 10) % 10;
+ xkb->names->keys[key].name[3] = '0' + (key / 1) % 10;
+
+ changes.names.changed |= XkbKeyNamesMask;
+ changes.names.first_key = key;
+ changes.names.num_keys = 1;
+ }
+
/* FIXME: Verify that ONE_LEVEL isn't screwed up */
types[XkbGroup1Index] = XkbOneLevelIndex;