diff --git a/src/Consolonia.Core/Infrastructure/DefaultNetConsole.cs b/src/Consolonia.Core/Infrastructure/DefaultNetConsole.cs index 47cf878a..2354baa3 100644 --- a/src/Consolonia.Core/Infrastructure/DefaultNetConsole.cs +++ b/src/Consolonia.Core/Infrastructure/DefaultNetConsole.cs @@ -30,14 +30,16 @@ public class DefaultNetConsole : InputLessDefaultNetConsole { ConsoleKey.LeftArrow, Key.Left }, { ConsoleKey.UpArrow, Key.Up }, { ConsoleKey.DownArrow, Key.Down }, - { ConsoleKey.Backspace, Key.Back } + { ConsoleKey.Backspace, Key.Back }, + { (ConsoleKey)18, Key.LeftAlt }, + { (ConsoleKey)16, Key.LeftShift }, + { (ConsoleKey)17, Key.LeftCtrl } }; - private static readonly FlagTranslator ModifiersFlagsTranslator = new(new[] - { + private static readonly FlagTranslator ModifiersFlagsTranslator = new([ (ConsoleModifiers.Control, RawInputModifiers.Control), (ConsoleModifiers.Shift, RawInputModifiers.Shift), (ConsoleModifiers.Alt, RawInputModifiers.Alt) - }); + ]); public DefaultNetConsole() { @@ -96,6 +98,9 @@ public static Key ConvertToKey(ConsoleKey consoleKey) { if (KeyMapping.TryGetValue(consoleKey, out Key key)) return key; + if (!Enum.IsDefined(consoleKey)) + throw new NotImplementedException(); + if (!Enum.TryParse(consoleKey.ToString(), out key)) throw new NotImplementedException(); return key;