Explorar o código

Fixes shift on windows, issue #85

See http://stackoverflow.com/questions/15966642/how-do-you-tell-lshift-apart-from-rshift-in-wm-keydown-events
cib %!s(int64=12) %!d(string=hai) anos
pai
achega
c5d28364f8
Modificáronse 1 ficheiros con 9 adicións e 1 borrados
  1. 9 1
      Core/Contents/Source/PolyWinCore.cpp

+ 9 - 1
Core/Contents/Source/PolyWinCore.cpp

@@ -476,13 +476,21 @@ PolyKEY Win32Core::mapKey(LPARAM lParam, WPARAM wParam) {
 						wParam = VK_RCONTROL;
 					else
 						wParam = VK_LCONTROL;
-				break;
+					break;
 				case 33:
 					if ( lParam&EXTENDED_KEYMASK )
 						wParam = VK_RMENU;
 					else
 						wParam = VK_LMENU;
 					break;
+				case VK_SHIFT:
+					// We can't tell if it's LSHIFT or RSHIFT,
+					// so use GetKeyState to tell which it is.
+					if( GetKeyState(VK_LSHIFT) ) {
+						wParam = VK_LSHIFT;
+					} else {
+						wParam = VK_RSHIFT;
+					}
 			}
 
 	return keyMap[(unsigned int)wParam];