Merge pull request #2346 from smoogipoo/joystick

Implement joystick input
This commit is contained in:
Dean Herbert 2018-05-13 01:50:14 +09:00 committed by GitHub
commit 9515eb4281
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 21 additions and 1 deletions

@ -1 +1 @@
Subproject commit f8079973011b54e84e5c0e677fe2b56e55947666
Subproject commit fac688633b8fcf34ae5d0514c26b03e217161eb4

View File

@ -223,6 +223,26 @@ protected override bool OnKeyUp(InputState state, KeyUpEventArgs args)
return true;
}
protected override bool OnJoystickPress(InputState state, Framework.Input.JoystickEventArgs args)
{
if (!HasFocus)
return false;
bindTarget.UpdateKeyCombination(KeyCombination.FromInputState(state));
finalise();
return true;
}
protected override bool OnJoystickRelease(InputState state, Framework.Input.JoystickEventArgs args)
{
if (!HasFocus)
return base.OnJoystickRelease(state, args);
finalise();
return true;
}
private void finalise()
{
if (bindTarget != null)