1
0
mirror of https://github.com/ppy/osu.git synced 2025-01-16 00:03:22 +08:00

Implement joystick keybindings

This commit is contained in:
smoogipoo 2018-04-03 02:04:40 +09:00
parent 25524bf24f
commit e9ec544bf6
2 changed files with 21 additions and 1 deletions

@ -1 +1 @@
Subproject commit 85b3494117ccef1b396b70957e1cffaba06e2b54
Subproject commit 3388ae24ba5cc75fc966ab1531f44701e74588a9

View File

@ -223,6 +223,26 @@ namespace osu.Game.Overlays.KeyBinding
return true;
}
protected override bool OnJoystickPress(InputState state, JoystickPressEventArgs args)
{
if (!HasFocus)
return false;
bindTarget.UpdateKeyCombination(KeyCombination.FromInputState(state));
finalise();
return true;
}
protected override bool OnJoystickRelease(InputState state, JoystickReleaseEventArgs args)
{
if (!HasFocus)
return base.OnJoystickRelease(state, args);
finalise();
return true;
}
private void finalise()
{
if (bindTarget != null)