From: Pierre Ossman Date: Thu, 23 May 2013 11:42:41 +0000 (+0000) Subject: XkbTranslateKeyCode() is not implemented according to X-Git-Tag: v1.3.90~106 X-Git-Url: https://source.dussan.org/?a=commitdiff_plain;h=6eb3607f55706c79bce43224d439a5066f008226;p=tigervnc.git XkbTranslateKeyCode() is not implemented according to specification in any system I can find, so change our code to follow reality rather than specification. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@5106 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- diff --git a/unix/xserver/hw/vnc/InputXKB.cc b/unix/xserver/hw/vnc/InputXKB.cc index f3211bf7..04e377c7 100644 --- a/unix/xserver/hw/vnc/InputXKB.cc +++ b/unix/xserver/hw/vnc/InputXKB.cc @@ -414,7 +414,14 @@ KeyCode InputDevice::keysymToKeycode(KeySym keysym, unsigned state, if (ks == NoSymbol) continue; - if (state_out & state & LockMask) + /* + * Despite every known piece of documentation on + * XkbTranslateKeyCode() stating that mods_rtrn returns + * the unconsumed modifiers, in reality it always + * returns the _potentially consumed_ modifiers. + */ + state_out = state & ~state_out; + if (state_out & LockMask) XkbConvertCase(ks, &dummy, &ks); if (ks == keysym)