mirror of
https://git.ryujinx.app/ryubing/ryujinx.git
synced 2025-04-24 06:47:44 +02:00
UI: Added the ability to unbind hotkeys via pressing backspace.
This commit is contained in:
parent
11ea020092
commit
57118e00fb
2 changed files with 6 additions and 12 deletions
|
@ -83,8 +83,13 @@ namespace Ryujinx.Ava.UI.Helpers
|
||||||
|
|
||||||
ToggledButton.IsChecked = false;
|
ToggledButton.IsChecked = false;
|
||||||
|
|
||||||
ButtonAssigned?.Invoke(this, new ButtonAssignedEventArgs(ToggledButton, pressedButton));
|
if (pressedButton.HasValue && pressedButton.Value.AsHidType<Key>() == Key.BackSpace)
|
||||||
|
{
|
||||||
|
ButtonAssigned?.Invoke(this, new ButtonAssignedEventArgs(ToggledButton, new Button(Key.Unbound)));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
|
ButtonAssigned?.Invoke(this, new ButtonAssignedEventArgs(ToggledButton, pressedButton));
|
||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -45,15 +45,6 @@ namespace Ryujinx.Ava.UI.Views.Settings
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void MouseClick(object sender, PointerPressedEventArgs e)
|
|
||||||
{
|
|
||||||
bool shouldUnbind = e.GetCurrentPoint(this).Properties.IsMiddleButtonPressed;
|
|
||||||
|
|
||||||
_currentAssigner?.Cancel(shouldUnbind);
|
|
||||||
|
|
||||||
PointerPressed -= MouseClick;
|
|
||||||
}
|
|
||||||
|
|
||||||
private void Button_IsCheckedChanged(object sender, RoutedEventArgs e)
|
private void Button_IsCheckedChanged(object sender, RoutedEventArgs e)
|
||||||
{
|
{
|
||||||
if (sender is ToggleButton button)
|
if (sender is ToggleButton button)
|
||||||
|
@ -71,8 +62,6 @@ namespace Ryujinx.Ava.UI.Views.Settings
|
||||||
|
|
||||||
this.Focus(NavigationMethod.Pointer);
|
this.Focus(NavigationMethod.Pointer);
|
||||||
|
|
||||||
PointerPressed += MouseClick;
|
|
||||||
|
|
||||||
IKeyboard keyboard = (IKeyboard)_avaloniaKeyboardDriver.GetGamepad("0");
|
IKeyboard keyboard = (IKeyboard)_avaloniaKeyboardDriver.GetGamepad("0");
|
||||||
IButtonAssigner assigner = new KeyboardKeyAssigner(keyboard);
|
IButtonAssigner assigner = new KeyboardKeyAssigner(keyboard);
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue