Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

196 alt key accelerators arent rendered #201

Merged
merged 4 commits into from
Dec 13, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 9 additions & 4 deletions src/Consolonia.Core/Infrastructure/DefaultNetConsole.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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 }
jinek marked this conversation as resolved.
Show resolved Hide resolved
};

private static readonly FlagTranslator<ConsoleModifiers, RawInputModifiers> ModifiersFlagsTranslator = new(new[]
{
private static readonly FlagTranslator<ConsoleModifiers, RawInputModifiers> ModifiersFlagsTranslator = new([
(ConsoleModifiers.Control, RawInputModifiers.Control),
(ConsoleModifiers.Shift, RawInputModifiers.Shift), (ConsoleModifiers.Alt, RawInputModifiers.Alt)
});
]);

public DefaultNetConsole()
{
Expand Down Expand Up @@ -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;
Expand Down
Loading