From 6eb3607f55706c79bce43224d439a5066f008226 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Thu, 23 May 2013 11:42:41 +0000 Subject: [PATCH] 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 --- unix/xserver/hw/vnc/InputXKB.cc | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) 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) -- 2.39.5