From b4d055e4e96b04f8d5fd499647914ee5f28009ce Mon Sep 17 00:00:00 2001 From: Isaac Marovitz Date: Fri, 23 Feb 2024 21:28:48 -0500 Subject: [PATCH] Move symbols out of locales --- src/Ryujinx.Ava/Assets/Locales/en_US.json | 12 ++----- .../UI/Helpers/KeyValueConverter.cs | 32 +++++++++++++++---- 2 files changed, 27 insertions(+), 17 deletions(-) diff --git a/src/Ryujinx.Ava/Assets/Locales/en_US.json b/src/Ryujinx.Ava/Assets/Locales/en_US.json index 7e3558845..b277a6c03 100644 --- a/src/Ryujinx.Ava/Assets/Locales/en_US.json +++ b/src/Ryujinx.Ava/Assets/Locales/en_US.json @@ -269,16 +269,8 @@ "KeyUnknown": "Unknown", "KeyShiftLeft": "Shift Left", "KeyShiftRight": "Shift Right", - "KeyControlLeft": "Control Left", - "KeyControlRight": "Control Right", - "KeyAltLeft": "Alt Left", - "KeyAltRight": "Alt Right", - "KeyOptLeft": "⌥ Left", - "KeyOptRight": "⌥ Right", - "KeyWinLeft": "⊞ Left", - "KeyWinRight": "⊞ Right", - "KeyCmdLeft": "⌘ Left", - "KeyCmdRight": "⌘ Right", + "KeySideLeft": "Left", + "KeySideRight": "Right", "KeyMenu": "Menu", "KeyUp": "Up", "KeyDown": "Down", diff --git a/src/Ryujinx.Ava/UI/Helpers/KeyValueConverter.cs b/src/Ryujinx.Ava/UI/Helpers/KeyValueConverter.cs index 1c4aa7b21..095a71209 100644 --- a/src/Ryujinx.Ava/UI/Helpers/KeyValueConverter.cs +++ b/src/Ryujinx.Ava/UI/Helpers/KeyValueConverter.cs @@ -17,12 +17,12 @@ namespace Ryujinx.Ava.UI.Helpers { Key.Unknown, LocaleKeys.KeyUnknown }, { Key.ShiftLeft, LocaleKeys.KeyShiftLeft }, { Key.ShiftRight, LocaleKeys.KeyShiftRight }, - { Key.ControlLeft, LocaleKeys.KeyControlLeft }, - { Key.ControlRight, LocaleKeys.KeyControlRight }, - { Key.AltLeft, OperatingSystem.IsMacOS() ? LocaleKeys.KeyOptLeft : LocaleKeys.KeyAltLeft }, - { Key.AltRight, OperatingSystem.IsMacOS() ? LocaleKeys.KeyOptRight : LocaleKeys.KeyAltRight }, - { Key.WinLeft, OperatingSystem.IsMacOS() ? LocaleKeys.KeyCmdLeft : LocaleKeys.KeyWinLeft }, - { Key.WinRight, OperatingSystem.IsMacOS() ? LocaleKeys.KeyCmdRight : LocaleKeys.KeyWinRight }, + { Key.ControlLeft, LocaleKeys.KeySideLeft }, + { Key.ControlRight, LocaleKeys.KeySideRight }, + { Key.AltLeft, LocaleKeys.KeySideLeft }, + { Key.AltRight, LocaleKeys.KeySideRight }, + { Key.WinLeft, LocaleKeys.KeySideLeft }, + { Key.WinRight, LocaleKeys.KeySideRight }, { Key.Up, LocaleKeys.KeyUp }, { Key.Down, LocaleKeys.KeyDown }, { Key.Left, LocaleKeys.KeyLeft }, @@ -128,7 +128,25 @@ namespace Ryujinx.Ava.UI.Helpers { if (_keysMap.TryGetValue(key, out LocaleKeys localeKey)) { - keyString = LocaleManager.Instance[localeKey]; + var symbol = ""; + + switch (key) + { + case Key.ControlLeft: + case Key.ControlRight: + symbol = OperatingSystem.IsMacOS() ? "⌃ " : "Ctrl "; + break; + case Key.WinLeft: + case Key.WinRight: + symbol = OperatingSystem.IsMacOS() ? "⌘ " : "⊞ "; + break; + case Key.AltLeft: + case Key.AltRight: + symbol = OperatingSystem.IsMacOS() ? "⌥ " : "Alt "; + break; + } + + keyString = symbol + LocaleManager.Instance[localeKey]; } else {