]> source.dussan.org Git - tigervnc.git/commitdiff
xkbcomp ignores keycodes without names, so make sure any keycode
authorPierre Ossman <ossman@cendio.se>
Thu, 23 May 2013 11:45:18 +0000 (11:45 +0000)
committerPierre Ossman <ossman@cendio.se>
Thu, 23 May 2013 11:45:18 +0000 (11:45 +0000)
we use actually has one.

git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@5108 3789f03b-4d11-0410-bbf8-ca57d06f2519

unix/xserver/hw/vnc/InputXKB.cc

index eadae269e107ba2451efd067c995d7c7c34b484d..a9796e06e56fb269ded41c2dcbd96da6839286b3 100644 (file)
@@ -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;