mirror of
https://github.com/ClassiCube/ClassiCube.git
synced 2025-09-16 02:56:09 -04:00
Fix issue where pressing right shift and holding it down continously, then pressing left shift and then releasing it would cause 'speed' to be left on. (Thanks 123DontMessWitMe)
This commit is contained in:
parent
5668b3328f
commit
88613a82ed
@ -261,11 +261,13 @@ namespace OpenTK.Platform.Windows
|
|||||||
// The behavior of this key is very strange. Unlike Control and Alt, there is no extended bit
|
// The behavior of this key is very strange. Unlike Control and Alt, there is no extended bit
|
||||||
// to distinguish between left and right keys. Moreover, pressing both keys and releasing one
|
// to distinguish between left and right keys. Moreover, pressing both keys and releasing one
|
||||||
// may result in both keys being held down (but not always).
|
// may result in both keys being held down (but not always).
|
||||||
ushort lShiftState = API.GetKeyState( (int)VirtualKeys.LSHIFT );
|
bool lShiftDown = (API.GetKeyState( (int)VirtualKeys.LSHIFT ) >> 15) == 1;
|
||||||
ushort rShiftState = API.GetKeyState( (int)VirtualKeys.RSHIFT );
|
bool rShiftDown = (API.GetKeyState( (int)VirtualKeys.RSHIFT ) >> 15) == 1;
|
||||||
|
|
||||||
Keyboard[Input.Key.ShiftLeft] = (lShiftState >> 15) == 1;
|
if( !pressed || lShiftDown != rShiftDown ) {
|
||||||
Keyboard[Input.Key.ShiftRight] = (rShiftState >> 15) == 1;
|
Keyboard[Input.Key.ShiftLeft] = lShiftDown;
|
||||||
|
Keyboard[Input.Key.ShiftRight] = rShiftDown;
|
||||||
|
}
|
||||||
return IntPtr.Zero;
|
return IntPtr.Zero;
|
||||||
|
|
||||||
case VirtualKeys.CONTROL:
|
case VirtualKeys.CONTROL:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user