aboutsummaryrefslogtreecommitdiff
path: root/Ryujinx.Ava/AppHost.cs
diff options
context:
space:
mode:
authorMutantAura <44103205+MutantAura@users.noreply.github.com>2022-07-24 19:44:47 +0100
committerGitHub <noreply@github.com>2022-07-24 15:44:47 -0300
commit62f8ceb60b969db65a24d312dde7c6513a07ec46 (patch)
treea52eaac963d4286f5cac0fabcd4d02b296d3c5fc /Ryujinx.Ava/AppHost.cs
parent1a888ae0871c5ef590c92b992b87f01f05a19637 (diff)
Resolution scaling hotkeys (#3185)1.1.191
* 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
Diffstat (limited to 'Ryujinx.Ava/AppHost.cs')
-rw-r--r--Ryujinx.Ava/AppHost.cs16
1 files changed, 16 insertions, 0 deletions
diff --git a/Ryujinx.Ava/AppHost.cs b/Ryujinx.Ava/AppHost.cs
index c6f2265c..22c4ab5e 100644
--- a/Ryujinx.Ava/AppHost.cs
+++ b/Ryujinx.Ava/AppHost.cs
@@ -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;
}