mirror of
https://github.com/gui-cs/Terminal.Gui.git
synced 2025-12-29 09:18:01 +01:00
Removed dead code. Packet vk is only used for symbols, never escape etc.
This commit is contained in:
@@ -1783,31 +1783,15 @@ namespace Terminal.Gui {
|
||||
if (original.Key != ConsoleKey.Packet)
|
||||
throw new ArgumentException ("Expected a ConsoleKeyInfo with a Key of Packet", nameof (original));
|
||||
|
||||
// there is no unicode value passed
|
||||
if (c == '\0') {
|
||||
return false;
|
||||
}
|
||||
|
||||
switch (c) {
|
||||
case '\t':
|
||||
result = original.Modifiers == ConsoleModifiers.Shift ? Key.BackTab : Key.Tab;
|
||||
return true;
|
||||
case '\u001b':
|
||||
result = Key.Esc;
|
||||
return true;
|
||||
case '\b':
|
||||
result = Key.Backspace;
|
||||
return true;
|
||||
case '\n':
|
||||
case '\r':
|
||||
result = Key.Enter;
|
||||
return true;
|
||||
|
||||
// do not have a explicit mapping and char is nonzero so
|
||||
// we can just treat the `Key` as a regular unicode entry
|
||||
default:
|
||||
result = (Key)c;
|
||||
return true;
|
||||
};
|
||||
result = (Key)c;
|
||||
return true;
|
||||
}
|
||||
#endregion
|
||||
}
|
||||
|
||||
@@ -619,8 +619,6 @@ namespace Terminal.Gui.ConsoleDrivers {
|
||||
[Theory]
|
||||
[InlineData ('A', true, false, false, Key.A)]
|
||||
[InlineData ('z', false, false, false, Key.z)]
|
||||
[InlineData (' ', false, false, false, Key.Space)]
|
||||
[InlineData ('\b', false, false, false, Key.Backspace)]
|
||||
[InlineData ('=', false, false, false, (Key)'=')]
|
||||
[InlineData ('+', true, false, false, (Key)'+')]
|
||||
public void TestVKPacket (char unicodeCharacter, bool shift, bool alt, bool control, Key expectedRemapping)
|
||||
|
||||
Reference in New Issue
Block a user