summaryrefslogtreecommitdiffstats
path: root/unix
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2018-07-25 20:02:02 +0200
committerPierre Ossman <ossman@cendio.se>2018-07-25 20:02:02 +0200
commit9ee59ecb78d47513ce5e2a365e57a931449998e2 (patch)
tree03ab906a8972941f937c83e948cef82009382ea2 /unix
parentc6ec366dfc08aef3e0bebd767ea593ba4a2a1356 (diff)
downloadtigervnc-9ee59ecb78d47513ce5e2a365e57a931449998e2.tar.gz
tigervnc-9ee59ecb78d47513ce5e2a365e57a931449998e2.zip
Handle Shift+Tab (ISO_Left_Tab) in x0vncserver
Diffstat (limited to 'unix')
-rw-r--r--unix/x0vncserver/XDesktop.cxx14
1 files changed, 10 insertions, 4 deletions
diff --git a/unix/x0vncserver/XDesktop.cxx b/unix/x0vncserver/XDesktop.cxx
index 59e25323..0273a6df 100644
--- a/unix/x0vncserver/XDesktop.cxx
+++ b/unix/x0vncserver/XDesktop.cxx
@@ -289,6 +289,7 @@ void XDesktop::pointerEvent(const Point& pos, int buttonMask) {
KeyCode XDesktop::XkbKeysymToKeycode(Display* dpy, KeySym keysym) {
XkbDescPtr xkb;
XkbStateRec state;
+ unsigned int mods;
unsigned keycode;
xkb = XkbGetMap(dpy, XkbAllComponentsMask, XkbUseCoreKbd);
@@ -296,15 +297,15 @@ KeyCode XDesktop::XkbKeysymToKeycode(Display* dpy, KeySym keysym) {
return 0;
XkbGetState(dpy, XkbUseCoreKbd, &state);
+ // XkbStateFieldFromRec() doesn't work properly because
+ // state.lookup_mods isn't properly updated, so we do this manually
+ mods = XkbBuildCoreState(XkbStateMods(&state), state.group);
for (keycode = xkb->min_key_code;
keycode <= xkb->max_key_code;
keycode++) {
KeySym cursym;
- unsigned int mods, out_mods;
- // XkbStateFieldFromRec() doesn't work properly because
- // state.lookup_mods isn't properly updated, so we do this manually
- mods = XkbBuildCoreState(XkbStateMods(&state), state.group);
+ unsigned int out_mods;
XkbTranslateKeyCode(xkb, keycode, mods, &out_mods, &cursym);
if (cursym == keysym)
break;
@@ -315,6 +316,11 @@ KeyCode XDesktop::XkbKeysymToKeycode(Display* dpy, KeySym keysym) {
XkbFreeKeyboard(xkb, XkbAllComponentsMask, True);
+ // Shift+Tab is usually ISO_Left_Tab, but RFB hides this fact. Do
+ // another attempt if we failed the initial lookup
+ if ((keycode == 0) && (keysym == XK_Tab) && (mods & ShiftMask))
+ return XkbKeysymToKeycode(dpy, XK_ISO_Left_Tab);
+
return keycode;
}
#endif