From 9c4d81c4f203a7e53147e008f75766799d5f420b Mon Sep 17 00:00:00 2001 From: the_fiddler Date: Fri, 4 Apr 2008 20:05:38 +0000 Subject: [PATCH] Fixed an arithmetic overflow exception in extended bit checking at WMInput.cs. --- Source/OpenTK/Platform/Windows/WMInput.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Source/OpenTK/Platform/Windows/WMInput.cs b/Source/OpenTK/Platform/Windows/WMInput.cs index 2a0dabd3..75d5b094 100644 --- a/Source/OpenTK/Platform/Windows/WMInput.cs +++ b/Source/OpenTK/Platform/Windows/WMInput.cs @@ -26,7 +26,7 @@ namespace OpenTK.Platform.Windows IList mice = new List(1); internal static readonly WinKeyMap KeyMap = new WinKeyMap(); // Used to distinguish left and right control, alt and enter keys. - const int ExtendedBit = 1 << 24; + const long ExtendedBit = 1 << 24; // Used to distinguish left and right shift keys. static readonly uint ShiftRightScanCode = Functions.MapVirtualKey(VirtualKeys.RSHIFT, 0); @@ -122,7 +122,7 @@ namespace OpenTK.Platform.Windows // Win95 does not distinguish left/right key constants (GetAsyncKeyState returns 0). // In this case, both keys will be reported as pressed. - bool extended = (((int)msg.LParam) & ExtendedBit) != 0; + bool extended = (msg.LParam.ToInt64() & ExtendedBit) != 0; switch ((VirtualKeys)msg.WParam) { case VirtualKeys.SHIFT: