Move symbols out of locales

This commit is contained in:
Isaac Marovitz 2024-02-23 21:28:48 -05:00
parent 7416aeee30
commit b4d055e4e9
No known key found for this signature in database
GPG key ID: 97250B2B09A132E1
2 changed files with 27 additions and 17 deletions

View file

@ -269,16 +269,8 @@
"KeyUnknown": "Unknown", "KeyUnknown": "Unknown",
"KeyShiftLeft": "Shift Left", "KeyShiftLeft": "Shift Left",
"KeyShiftRight": "Shift Right", "KeyShiftRight": "Shift Right",
"KeyControlLeft": "Control Left", "KeySideLeft": "Left",
"KeyControlRight": "Control Right", "KeySideRight": "Right",
"KeyAltLeft": "Alt Left",
"KeyAltRight": "Alt Right",
"KeyOptLeft": "⌥ Left",
"KeyOptRight": "⌥ Right",
"KeyWinLeft": "⊞ Left",
"KeyWinRight": "⊞ Right",
"KeyCmdLeft": "⌘ Left",
"KeyCmdRight": "⌘ Right",
"KeyMenu": "Menu", "KeyMenu": "Menu",
"KeyUp": "Up", "KeyUp": "Up",
"KeyDown": "Down", "KeyDown": "Down",

View file

@ -17,12 +17,12 @@ namespace Ryujinx.Ava.UI.Helpers
{ Key.Unknown, LocaleKeys.KeyUnknown }, { Key.Unknown, LocaleKeys.KeyUnknown },
{ Key.ShiftLeft, LocaleKeys.KeyShiftLeft }, { Key.ShiftLeft, LocaleKeys.KeyShiftLeft },
{ Key.ShiftRight, LocaleKeys.KeyShiftRight }, { Key.ShiftRight, LocaleKeys.KeyShiftRight },
{ Key.ControlLeft, LocaleKeys.KeyControlLeft }, { Key.ControlLeft, LocaleKeys.KeySideLeft },
{ Key.ControlRight, LocaleKeys.KeyControlRight }, { Key.ControlRight, LocaleKeys.KeySideRight },
{ Key.AltLeft, OperatingSystem.IsMacOS() ? LocaleKeys.KeyOptLeft : LocaleKeys.KeyAltLeft }, { Key.AltLeft, LocaleKeys.KeySideLeft },
{ Key.AltRight, OperatingSystem.IsMacOS() ? LocaleKeys.KeyOptRight : LocaleKeys.KeyAltRight }, { Key.AltRight, LocaleKeys.KeySideRight },
{ Key.WinLeft, OperatingSystem.IsMacOS() ? LocaleKeys.KeyCmdLeft : LocaleKeys.KeyWinLeft }, { Key.WinLeft, LocaleKeys.KeySideLeft },
{ Key.WinRight, OperatingSystem.IsMacOS() ? LocaleKeys.KeyCmdRight : LocaleKeys.KeyWinRight }, { Key.WinRight, LocaleKeys.KeySideRight },
{ Key.Up, LocaleKeys.KeyUp }, { Key.Up, LocaleKeys.KeyUp },
{ Key.Down, LocaleKeys.KeyDown }, { Key.Down, LocaleKeys.KeyDown },
{ Key.Left, LocaleKeys.KeyLeft }, { Key.Left, LocaleKeys.KeyLeft },
@ -128,7 +128,25 @@ namespace Ryujinx.Ava.UI.Helpers
{ {
if (_keysMap.TryGetValue(key, out LocaleKeys localeKey)) 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 else
{ {