mirror of
https://github.com/Ryujinx/Opentk.git
synced 2024-12-23 03:35:28 +00:00
[Input] Fixed SetButton index check
This commit is contained in:
parent
4fceca2f80
commit
2dee96d918
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue