From 02ef70b211e49aadfab3b8f645a7a6bd29695155 Mon Sep 17 00:00:00 2001 From: Pierre Ossman Date: Tue, 16 Apr 2013 09:03:18 +0000 Subject: [PATCH] Shifted Tab is a generic VNC problem and not specific to just Core keyboard. Move handling of it to the central code. git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@5082 3789f03b-4d11-0410-bbf8-ca57d06f2519 --- unix/xserver/hw/vnc/Input.cc | 16 ++++++++++++++++ unix/xserver/hw/vnc/InputCore.cc | 16 ---------------- 2 files changed, 16 insertions(+), 16 deletions(-) diff --git a/unix/xserver/hw/vnc/Input.cc b/unix/xserver/hw/vnc/Input.cc index 6fc007be..f1f8e112 100644 --- a/unix/xserver/hw/vnc/Input.cc +++ b/unix/xserver/hw/vnc/Input.cc @@ -510,6 +510,22 @@ void InputDevice::keyEvent(rdr::U32 keysym, bool down) new_state = state; } + /* + * "Shifted Tab" is a bit of a mess. Some systems have varying, + * special keysyms for this symbol. VNC mandates that clients + * should always send the plain XK_Tab keysym and the server + * should deduce the meaning based on current Shift state. + * To comply with this, we will find the keycode that sends + * XK_Tab, and make sure that Shift isn't cleared. This can + * possibly result in a different keysym than XK_Tab, but that + * is the desired behaviour. + * + * Note: We never get ISO_Left_Tab here because it's already + * been translated in VNCSConnectionST. + */ + if (keysym == XK_Tab && (state & ShiftMask)) + new_state |= ShiftMask; + /* * We need a bigger state change than just shift, * so we need to know what the mask is for level 3 shifts. diff --git a/unix/xserver/hw/vnc/InputCore.cc b/unix/xserver/hw/vnc/InputCore.cc index 0fc4fe1e..de7653ef 100644 --- a/unix/xserver/hw/vnc/InputCore.cc +++ b/unix/xserver/hw/vnc/InputCore.cc @@ -441,22 +441,6 @@ KeyCode InputDevice::keysymToKeycode(KeySym keysym, unsigned state, unsigned *ne if (j & 0x2) *new_state |= mask; - /* - * Sort out the "shifted Tab" mess. If - * we are sent a shifted Tab, generate - * a local shifted Tab regardless of - * what the "shifted Tab" keysym is on - * the local keyboard (it might be Tab, - * ISO_Left_Tab or HP's private BackTab - * keysym, and quite possibly some - * others too). We never get - * ISO_Left_Tab here because it's - * already been translated in - * VNCSConnectionST. - */ - if (keysym == XK_Tab && (state & ShiftMask)) - *new_state |= ShiftMask; - return i; } } -- 2.39.5