Merge pull request #389 from MichaelTheShifter/console

Added more keys to the ConsoleKeyEx -> ConsoleKey converter.
This commit is contained in:
Matthijs ter Woord 2016-06-26 19:09:01 +02:00 committed by GitHub
commit 8cfa0b89ca
2 changed files with 31 additions and 1 deletions

View file

@ -140,6 +140,37 @@ namespace Cosmos.HAL
return ConsoleKey.RightArrow;
case ConsoleKeyEx.Sleep:
return ConsoleKey.Sleep;
case ConsoleKeyEx.BiggerThan:
case ConsoleKeyEx.Period:
return ConsoleKey.OemPeriod;
case ConsoleKeyEx.LowerThan:
case ConsoleKeyEx.Comma:
return ConsoleKey.OemComma;
case ConsoleKeyEx.NumPeriod:
return ConsoleKey.Decimal;
case ConsoleKeyEx.NumPlus:
return ConsoleKey.Add;
case ConsoleKeyEx.NumEnter:
return ConsoleKey.Enter;
case ConsoleKeyEx.Backslash:
return ConsoleKey.Oem5;
case ConsoleKeyEx.LBracket:
return ConsoleKey.Oem4;
case ConsoleKeyEx.RBracket:
return ConsoleKey.Oem6;
case ConsoleKeyEx.Minus:
return ConsoleKey.OemMinus;
case ConsoleKeyEx.Apostrophe:
return ConsoleKey.Oem7;
case ConsoleKeyEx.Slash:
return ConsoleKey.Oem2;
case ConsoleKeyEx.Equal:
return ConsoleKey.OemPlus;
case ConsoleKeyEx.Backquote:
return ConsoleKey.Oem3;
case ConsoleKeyEx.Semicolon:
case ConsoleKeyEx.Colon:
return ConsoleKey.Oem1;
default:
throw new Exception("KeyEx not implemented!");
}

View file

@ -382,7 +382,6 @@ namespace Cosmos.System.Plugs.System
public static ConsoleKeyInfo ReadKey(Boolean intercept)
{
var key = Cosmos.HAL.Global.Keyboard.ReadKey();
if (false == intercept && key.KeyChar != '\0')
{
Write(key.KeyChar);