[Input] Cleaned up line endings and joystick hat mapping

This commit is contained in:
thefiddler 2014-07-29 23:21:37 +02:00
parent fe1d465b85
commit e243316e8e
2 changed files with 25 additions and 24 deletions

View file

@ -122,24 +122,25 @@ namespace OpenTK.Platform
{
// JoystickHat -> Buttons/GamePadAxes mapping
JoystickHat source_hat = map.Source.Hat;
JoystickHatState state = joy.GetHat(source_hat);
bool pressed = false;
switch (map.Source.HatPosition)
{
case HatPosition.Down:
pressed = joy.GetHat(source_hat).IsDown;
pressed = state.IsDown;
break;
case HatPosition.Up:
pressed = joy.GetHat(source_hat).IsUp;
pressed = state.IsUp;
break;
case HatPosition.Left:
pressed = joy.GetHat(source_hat).IsLeft;
pressed = state.IsLeft;
break;
case HatPosition.Right:
pressed = joy.GetHat(source_hat).IsRight;
pressed = state.IsRight;
break;
}