Cosmos/source/Cosmos.System.Plugs/System/ConsolePalImpl.cs
José Pedro 7228f90bc4 Tests fixes.
Improved IL2CPU assembly loading.
Fixed PlugManager bug.
2017-04-27 00:48:18 +01:00

23 lines
717 B
C#

using System;
using Cosmos.IL2CPU.Plugs;
namespace Cosmos.System.Plugs.System
{
[Plug(TargetName = "System.ConsolePal, System.Console")]
public class ConsolePalImpl
{
// ReadKey() pure CIL
public static ConsoleKeyInfo ReadKey(bool intercept)
{
var key = KeyboardManager.ReadKey();
if (intercept == false && key.KeyChar != '\0')
{
global::System.Console.Write(key.KeyChar);
}
return new ConsoleKeyInfo(key.KeyChar, key.Key.ToConsoleKey(), (key.Modifiers & ConsoleModifiers.Shift) != 0, (key.Modifiers & ConsoleModifiers.Alt) != 0, (key.Modifiers & ConsoleModifiers.Control) != 0);
}
}
}