Merge remote-tracking branch 'refs/remotes/CosmosOS/master'

This commit is contained in:
GeomTech 2017-09-17 18:55:06 +02:00
commit 57ac3530cf
4 changed files with 35 additions and 28 deletions

View file

@ -83,7 +83,7 @@ Source: ".\Build\VSIP\NASM\*"; DestDir: "{app}\Build\NASM"; Flags: ignoreversion
Source: ".\Build\VSIP\Cosmos.Deploy.USB.exe"; DestDir: "{app}\Build\Tools"; Flags: ignoreversion uninsremovereadonly
Source: ".\Build\VSIP\Cosmos.Deploy.Pixie.exe"; DestDir: "{app}\Build\Tools"; Flags: ignoreversion uninsremovereadonly
Source: ".\Build\VSIP\Cosmos.Build.Common.dll"; DestDir: "{app}\Build\Tools"; Flags: ignoreversion uninsremovereadonly
Source: ".\Build\VSIP\MSBuild\*"; DestDir: "{app}\Build\VSIP\"; Flags: ignoreversion uninsremovereadonly
Source: ".\Build\VSIP\MSBuild\*"; DestDir: "{app}\Build\VSIP\"; Flags: ignoreversion recursesubdirs uninsremovereadonly
Source: ".\Build\VSIP\Cosmos.Debug.GDB.exe"; DestDir: "{app}\Build\VSIP\"; Flags: ignoreversion uninsremovereadonly
; Kernel assemblies
Source: ".\Build\VSIP\Cosmos.Debug.Kernel*"; DestDir: "{app}\Kernel"; Flags: ignoreversion uninsremovereadonly

View file

@ -48,8 +48,17 @@ namespace Cosmos.System
get;
set;
}
public static bool KeyAvailable
{
get
{
return mQueuedKeys.Count > 0;
}
}
public static List<KeyboardBase> Keyboards = new List<KeyboardBase>();
public static List<KeyboardBase> Keyboards = new List<KeyboardBase>();
private static ScanMapBase _scanMap = new US_Standard();
private static Queue<KeyEvent> mQueuedKeys = new Queue<KeyEvent>();

View file

@ -199,8 +199,7 @@ namespace Cosmos.System_Plugs.System
public static bool get_KeyAvailable()
{
WriteLine("Not implemented: get_KeyAvailable");
return false;
return KeyboardManager.KeyAvailable;
}
public static int get_LargestWindowHeight()
@ -394,6 +393,29 @@ namespace Cosmos.System_Plugs.System
}
}
// ReadKey() pure CIL
public static ConsoleKeyInfo ReadKey(bool intercept)
{
var key = KeyboardManager.ReadKey();
if (intercept == false && key.KeyChar != '\0')
{
Write(key.KeyChar);
}
//TODO: Plug HasFlag and use the next 3 lines instead of the 3 following lines
//bool xShift = key.Modifiers.HasFlag(ConsoleModifiers.Shift);
//bool xAlt = key.Modifiers.HasFlag(ConsoleModifiers.Alt);
//bool xControl = key.Modifiers.HasFlag(ConsoleModifiers.Control);
bool xShift = (key.Modifiers & ConsoleModifiers.Shift) == ConsoleModifiers.Shift;
bool xAlt = (key.Modifiers & ConsoleModifiers.Alt) == ConsoleModifiers.Alt;
bool xControl = (key.Modifiers & ConsoleModifiers.Control) == ConsoleModifiers.Control;
return new ConsoleKeyInfo(key.KeyChar, key.Key.ToConsoleKey(), xShift, xAlt, xControl);
}
public static String ReadLine()
{
var xConsole = GetConsole();

View file

@ -1,24 +0,0 @@
using System;
using Cosmos.System;
using Cosmos.IL2CPU.API;
using Cosmos.IL2CPU.API.Attribs;
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);
}
}
}