Resolution scaling hotkeys (#3185)
* hotkeys * comments * update implementation to include custom scales * copypasta * review changes * hotkeys * comments * update implementation to include custom scales * copypasta * review changes * Remove outdated configuration and force hotkeys unbound * Add avalonia support * Fix configuration file * Update GTK implementation and fix config... again. * Remove legacy implementation + nits * Avalonia locales (DeepL) * review * Remove colon from chinese locale * Update ConfigFile * locale fix
This commit is contained in:
parent
1a888ae087
commit
62f8ceb60b
14 changed files with 109 additions and 14 deletions
|
@ -53,6 +53,7 @@ namespace Ryujinx.Ava
|
|||
internal class AppHost
|
||||
{
|
||||
private const int CursorHideIdleTime = 8; // Hide Cursor seconds
|
||||
private const float MaxResolutionScale = 4.0f; // Max resolution hotkeys can scale to before wrapping.
|
||||
|
||||
private static readonly Cursor InvisibleCursor = new Cursor(StandardCursorType.None);
|
||||
|
||||
|
@ -976,6 +977,13 @@ namespace Ryujinx.Ava
|
|||
|
||||
_parent.ViewModel.Volume = Device.GetVolume();
|
||||
break;
|
||||
case KeyboardHotkeyState.ResScaleUp:
|
||||
GraphicsConfig.ResScale = GraphicsConfig.ResScale % MaxResolutionScale + 1;
|
||||
break;
|
||||
case KeyboardHotkeyState.ResScaleDown:
|
||||
GraphicsConfig.ResScale =
|
||||
(MaxResolutionScale + GraphicsConfig.ResScale - 2) % MaxResolutionScale + 1;
|
||||
break;
|
||||
case KeyboardHotkeyState.None:
|
||||
(_keyboardInterface as AvaloniaKeyboard).Clear();
|
||||
break;
|
||||
|
@ -1033,6 +1041,14 @@ namespace Ryujinx.Ava
|
|||
{
|
||||
state = KeyboardHotkeyState.ToggleMute;
|
||||
}
|
||||
else if (_keyboardInterface.IsPressed((Key)ConfigurationState.Instance.Hid.Hotkeys.Value.ResScaleUp))
|
||||
{
|
||||
state = KeyboardHotkeyState.ResScaleUp;
|
||||
}
|
||||
else if (_keyboardInterface.IsPressed((Key)ConfigurationState.Instance.Hid.Hotkeys.Value.ResScaleDown))
|
||||
{
|
||||
state = KeyboardHotkeyState.ResScaleDown;
|
||||
}
|
||||
|
||||
return state;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue