diff options
author | Pierre Ossman <ossman@cendio.se> | 2013-05-29 12:33:59 +0000 |
---|---|---|
committer | Pierre Ossman <ossman@cendio.se> | 2013-05-29 12:33:59 +0000 |
commit | 159cb83a0a818041c8dfc6f47029eb8385e373e0 (patch) | |
tree | 409c03e72fcad380ad61014ce6554b3ef3c359cb /vncviewer | |
parent | 5010488214d3df9fb6dc64484e479451dd3e5c41 (diff) | |
download | tigervnc-159cb83a0a818041c8dfc6f47029eb8385e373e0.tar.gz tigervnc-159cb83a0a818041c8dfc6f47029eb8385e373e0.zip |
The numpad decimal hack is needed on OS X as well.
git-svn-id: svn://svn.code.sf.net/p/tigervnc/code/trunk@5115 3789f03b-4d11-0410-bbf8-ca57d06f2519
Diffstat (limited to 'vncviewer')
-rw-r--r-- | vncviewer/Viewport.cxx | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/vncviewer/Viewport.cxx b/vncviewer/Viewport.cxx index 25c41103..9fd849f8 100644 --- a/vncviewer/Viewport.cxx +++ b/vncviewer/Viewport.cxx @@ -594,13 +594,20 @@ rdr::U32 Viewport::translateKeyEvent(int keyCode, int origKeyCode, const char *k } #endif -#ifdef WIN32 +#if defined(WIN32) || defined(__APPLE__) // X11 fairly consistently uses XK_KP_Separator for comma and - // XK_KP_Decimal for period. Windows unfortunately is terribly - // inconcistent, and is not something that's likely to change: + // XK_KP_Decimal for period. Windows and OS X are a different matter + // though. + // + // OS X will consistently generate the same key code no matter what + // layout is being used. + // + // Windows is terribly inconcistent, and is not something that's + // likely to change: // http://blogs.msdn.com/michkap/archive/2006/09/13/752377.aspx - // To work around this we look at what character the key generates - // and try to follow X11 behaviour. + // + // To get X11 behaviour, we instead look at the text generated by + // they key. if ((keyCode == (FL_KP + ',')) || (keyCode == (FL_KP + '.'))) { switch (keyText[0]) { case ',': |