diff options
author | Pierre Ossman <ossman@cendio.se> | 2013-05-23 11:46:35 +0000 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2013-05-23 11:46:35 +0000 |
commit | 40550116f56a5268ecdcdcf38db91d3b553e8811 (patch) | |
tree | e849c1d15d12b1cc3045ded471e399a17be8a84c /unix/xserver/hw/vnc | |
parent | 06c20e55624d74fe893235d45814324ef9f084b4 (diff) | |
download | tigervnc-40550116f56a5268ecdcdcf38db91d3b553e8811.tar.gz tigervnc-40550116f56a5268ecdcdcf38db91d3b553e8811.zip |
Adding normal alphabetic keysyms as ONE_LEVEL did not behave
correctly when CapsLock is active, so start using the ALPHABETIC
type for those instead.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@5109 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'unix/xserver/hw/vnc')
-rw-r--r-- | unix/xserver/hw/vnc/InputXKB.cc | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/unix/xserver/hw/vnc/InputXKB.cc b/unix/xserver/hw/vnc/InputXKB.cc index a9796e06..7bc23778 100644 --- a/unix/xserver/hw/vnc/InputXKB.cc +++ b/unix/xserver/hw/vnc/InputXKB.cc @@ -485,6 +485,7 @@ KeyCode InputDevice::addKeysym(KeySym keysym, unsigned state) int types[1]; KeySym *syms; + KeySym upper, lower; master = GetMaster(keyboardDev, KEYBOARD_OR_FLOAT); xkb = master->key->xkbInfo->desc; @@ -517,13 +518,28 @@ KeyCode InputDevice::addKeysym(KeySym keysym, unsigned state) changes.names.num_keys = 1; } - /* FIXME: Verify that ONE_LEVEL isn't screwed up */ + /* FIXME: Verify that ONE_LEVEL/ALPHABETIC isn't screwed up */ + + /* + * For keysyms that are affected by Lock, we are better off + * using ALPHABETIC rather than ONE_LEVEL as the latter + * generally cannot produce lower case when Lock is active. + */ + XkbConvertCase(keysym, &lower, &upper); + if (upper == lower) + types[XkbGroup1Index] = XkbOneLevelIndex; + else + types[XkbGroup1Index] = XkbAlphabeticIndex; - types[XkbGroup1Index] = XkbOneLevelIndex; XkbChangeTypesOfKey(xkb, key, 1, XkbGroup1Mask, types, &changes.map); syms = XkbKeySymsPtr(xkb,key); - syms[0] = keysym; + if (upper == lower) + syms[0] = keysym; + else { + syms[0] = lower; + syms[1] = upper; + } changes.map.changed |= XkbKeySymsMask; changes.map.first_key_sym = key; |