Revision: 5083
          http://tigervnc.svn.sourceforge.net/tigervnc/?rev=5083&view=rev
Author:   ossman_
Date:     2013-04-16 11:56:29 +0000 (Tue, 16 Apr 2013)
Log Message:
-----------
Work around Windows poor handling of the numpad decimal key.

Modified Paths:
--------------
    trunk/vncviewer/Viewport.cxx

Modified: trunk/vncviewer/Viewport.cxx
===================================================================
--- trunk/vncviewer/Viewport.cxx        2013-04-16 09:03:18 UTC (rev 5082)
+++ trunk/vncviewer/Viewport.cxx        2013-04-16 11:56:29 UTC (rev 5083)
@@ -594,6 +594,26 @@
   }
 #endif
 
+#ifdef WIN32
+  // 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:
+  // 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.
+  if ((keyCode == (FL_KP + ',')) || (keyCode == (FL_KP + '.'))) {
+    switch (keyText[0]) {
+    case ',':
+      return XK_KP_Separator;
+    case '.':
+      return XK_KP_Decimal;
+    default:
+      vlog.error(_("Unknown decimal separator: '%s'"), keyText);
+      return XK_KP_Decimal;
+    }
+  }
+#endif
+
   // Then other special keys
   switch (keyCode) {
   case FL_BackSpace:

This was sent by the SourceForge.net collaborative development platform, the 
world's largest Open Source development site.


------------------------------------------------------------------------------
Precog is a next-generation analytics platform capable of advanced
analytics on semi-structured data. The platform includes APIs for building
apps and a phenomenal toolset for data science. Developers can use
our toolset for easy data analysis & visualization. Get a free account!
http://www2.precog.com/precogplatform/slashdotnewsletter
_______________________________________________
Tigervnc-commits mailing list
Tigervnc-commits@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/tigervnc-commits

Reply via email to