aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPierre Ossman <ossman@cendio.se>2011-07-14 13:35:48 +0000
committerPierre Ossman <ossman@cendio.se>2011-07-14 13:35:48 +0000
commitaa336beee7dc0c4310ac00b6daff178ecd9101e1 (patch)
tree4cb4323a01b7d05a19aadcb67a54fca74dcb9c0d
parent8c15d12a8538b514fbaae68a5030830d332eb9b8 (diff)
downloadtigervnc-aa336beee7dc0c4310ac00b6daff178ecd9101e1.tar.gz
tigervnc-aa336beee7dc0c4310ac00b6daff178ecd9101e1.zip
Workaround for Alt behaviour on OS X.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@4587 3789f03b-4d11-0410-bbf8-ca57d06f2519
-rw-r--r--vncviewer/Viewport.cxx17
1 files changed, 17 insertions, 0 deletions
diff --git a/vncviewer/Viewport.cxx b/vncviewer/Viewport.cxx
index 019d99e1..2d197fcc 100644
--- a/vncviewer/Viewport.cxx
+++ b/vncviewer/Viewport.cxx
@@ -539,6 +539,23 @@ rdr::U32 Viewport::translateKeyEvent(int keyCode, int origKeyCode, const char *k
}
}
+#ifdef __APPLE__
+ // Alt on OS X behaves more like AltGr on other systems, and to get
+ // sane behaviour we should translate things in that manner for the
+ // remote VNC server. However that means we lose the ability to use
+ // Alt as a shortcut modifier. Do what RealVNC does and hijack the
+ // left command key as an Alt replacement.
+ switch (keyCode) {
+ case FL_Meta_L:
+ return XK_Alt_L;
+ case FL_Meta_R:
+ return XK_Super_L;
+ case FL_Alt_L:
+ case FL_Alt_R:
+ return XK_ISO_Level3_Shift;
+ }
+#endif
+
// Then other special keys
switch (keyCode) {
case FL_BackSpace: