Removed dead code. Packet vk is only used for symbols, never escape etc.

This commit is contained in:
tznind
2022-09-20 16:05:54 +01:00
parent 35e79a9f64
commit bb6187075e
2 changed files with 3 additions and 21 deletions

View File

@@ -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
}

View File

@@ -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)