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); } }