mirror of
https://github.com/Ryujinx/Opentk.git
synced 2025-05-13 09:52:15 +00:00
[Input] Cleaned up line endings and joystick hat mapping
This commit is contained in:
parent
fe1d465b85
commit
e243316e8e
|
@ -122,24 +122,25 @@ namespace OpenTK.Platform
|
||||||
{
|
{
|
||||||
// JoystickHat -> Buttons/GamePadAxes mapping
|
// JoystickHat -> Buttons/GamePadAxes mapping
|
||||||
JoystickHat source_hat = map.Source.Hat;
|
JoystickHat source_hat = map.Source.Hat;
|
||||||
|
JoystickHatState state = joy.GetHat(source_hat);
|
||||||
|
|
||||||
bool pressed = false;
|
bool pressed = false;
|
||||||
switch (map.Source.HatPosition)
|
switch (map.Source.HatPosition)
|
||||||
{
|
{
|
||||||
case HatPosition.Down:
|
case HatPosition.Down:
|
||||||
pressed = joy.GetHat(source_hat).IsDown;
|
pressed = state.IsDown;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case HatPosition.Up:
|
case HatPosition.Up:
|
||||||
pressed = joy.GetHat(source_hat).IsUp;
|
pressed = state.IsUp;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case HatPosition.Left:
|
case HatPosition.Left:
|
||||||
pressed = joy.GetHat(source_hat).IsLeft;
|
pressed = state.IsLeft;
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case HatPosition.Right:
|
case HatPosition.Right:
|
||||||
pressed = joy.GetHat(source_hat).IsRight;
|
pressed = state.IsRight;
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue