From 2dee96d91845bf14ce6309d6fffd995342f44489 Mon Sep 17 00:00:00 2001 From: "Stefanos A." Date: Fri, 31 Jan 2014 16:40:57 +0100 Subject: [PATCH] [Input] Fixed SetButton index check --- Source/OpenTK/Input/JoystickState.cs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/Source/OpenTK/Input/JoystickState.cs b/Source/OpenTK/Input/JoystickState.cs index 6972bac9..1ef3d976 100644 --- a/Source/OpenTK/Input/JoystickState.cs +++ b/Source/OpenTK/Input/JoystickState.cs @@ -224,17 +224,17 @@ namespace OpenTK.Input internal void SetButton(JoystickButton button, bool value) { - int index = 1 << (int)button; + int index = (int)button; if (index < 0 || index >= MaxButtons) throw new ArgumentOutOfRangeException("button"); if (value) { - buttons |= index; + buttons |= 1 << index; } else { - buttons &= ~index; + buttons &= ~(1 << index); } }