Moved Terminal stuff to kernel project

This commit is contained in:
Anthony Wilcox 2020-01-30 11:19:54 -05:00
parent f8a919ba3a
commit 972948948f
6 changed files with 17 additions and 41 deletions

View file

@ -1,6 +1,6 @@
# TOMAS
TOMAS, an abbreviation of **To**ny's **Ma**naged Operating **S**ystem is a operating system written in C# using the [COSMOS](https://github.com/CosmosOS/Cosmos) framework.
TOMAS, an abbreviation of **To**ny's **Ma**naged Operating **S**ystem, is a operating system written in C# using the [COSMOS](https://github.com/CosmosOS/Cosmos) framework.
## Requirements

View file

@ -2,7 +2,7 @@
// See the LICENSE file in the project root for more information.
using System;
namespace Tomas.Common
namespace Tomas.Kernel
{
internal class EasterEggs
{

View file

@ -1,7 +1,6 @@
// TOMAS is licensed under the MPL 2.0 license.
// See the LICENSE file in the project root for more information.
using System;
using Tomas.Common;
using Tomas.Kernel.Programs;
using Sys = Cosmos.System;

View file

@ -1,6 +1,6 @@
// TOMAS is licensed under the MPL 2.0 license.
// See the LICENSE file in the project root for more information.
namespace Tomas.Common
namespace Tomas.Kernel
{
public struct OSConsts
{

View file

@ -2,48 +2,14 @@
// See the LICENSE file in the project root for more information.
using System;
namespace Tomas.Common
namespace Tomas.Kernel
{
public class Terminal
{
const char SYMBOL = '$';
public static bool IsCancelKey
{
get
{
var keys = Console.ReadKey();
if (keys.Modifiers == ConsoleModifiers.Control &&
keys.Key == ConsoleKey.C)
return true;
return false;
}
}
public static bool IsHelpKey
{
get
{
var keys = Console.ReadKey();
if (keys.Modifiers == ConsoleModifiers.Control &&
keys.Key == ConsoleKey.H)
return true;
return false;
}
}
public static bool IsEscapeKey
{
get
{
if (Console.ReadKey().Key == ConsoleKey.Escape)
return true;
return false;
}
}
public static TerminalCancelEventHandler CancelKeyHandler;
static void Commands(string command)
{

View file

@ -0,0 +1,11 @@
using System;
namespace Tomas.Kernel
{
public delegate void TerminalCancelEventHandler(object sender, TerminalCancelEventArgs e);
public sealed class TerminalCancelEventArgs : EventArgs
{
public bool Cancel { get; set; }
}
}