diff options
author | Pierre Ossman <ossman@cendio.se> | 2013-05-23 11:45:18 +0000 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2013-05-23 11:45:18 +0000 |
commit | 06c20e55624d74fe893235d45814324ef9f084b4 (patch) | |
tree | 7aac9d636bb55d690f94b64adbccfab79c8b377d | |
parent | 95eb36bfa9b664b9d50c9dfdb49db4aa0a3fb913 (diff) | |
download | tigervnc-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.cc | 16 |
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; |