Author: bgbnbigben
Date: 2011-04-01 19:41:00 -0700 (Fri, 01 Apr 2011)
New Revision: 8556
Log:
Slight modification to the way lshift/rshift are detected on WIN32 platforms, 
and a slight optimisation to ensure the recently added GetKeyState isn't called 
for every event

Modified:
   trunk/src/win32/run.cxx

Modified: trunk/src/win32/run.cxx
===================================================================
--- trunk/src/win32/run.cxx     2011-04-01 17:19:34 UTC (rev 8555)
+++ trunk/src/win32/run.cxx     2011-04-02 02:41:00 UTC (rev 8556)
@@ -1436,10 +1436,11 @@
     for (i = 0; i < 256; i++) if (!extendedlut[i]) extendedlut[i] = vklut[i];
   }
   static bool rShiftWasOn = false;
-  if (HIWORD(GetKeyState(VK_RSHIFT)) && !rShiftWasOn) {
+  
+  if (vk == VK_SHIFT && HIWORD(GetKeyState(VK_RSHIFT)) && !rShiftWasOn) {
     rShiftWasOn = true;
-    lParam |= 1 << 24;
-  } else if (rShiftWasOn) {
+    if (rShiftWasOn) lParam |= 1 << 24;
+  } else if (vk == VK_SHIFT && rShiftWasOn && !HIWORD(GetKeyState(VK_RSHIFT))) 
{
     rShiftWasOn = false;
     lParam |= 1 << 24;
   }

_______________________________________________
fltk-commit mailing list
[email protected]
http://lists.easysw.com/mailman/listinfo/fltk-commit

Reply via email to