diff --git a/README.md b/README.md index 4e0c934..3780d07 100644 --- a/README.md +++ b/README.md @@ -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 diff --git a/src/Tomas.Common/EasterEggs.cs b/src/Tomas.Kernel/EasterEggs.cs similarity index 97% rename from src/Tomas.Common/EasterEggs.cs rename to src/Tomas.Kernel/EasterEggs.cs index 60b55e6..16bcf2a 100644 --- a/src/Tomas.Common/EasterEggs.cs +++ b/src/Tomas.Kernel/EasterEggs.cs @@ -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 { diff --git a/src/Tomas.Kernel/Kernel.cs b/src/Tomas.Kernel/Kernel.cs index 5858565..2a9175d 100644 --- a/src/Tomas.Kernel/Kernel.cs +++ b/src/Tomas.Kernel/Kernel.cs @@ -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; diff --git a/src/Tomas.Common/OSConsts.cs b/src/Tomas.Kernel/OSConsts.cs similarity index 92% rename from src/Tomas.Common/OSConsts.cs rename to src/Tomas.Kernel/OSConsts.cs index 0ff7c74..9588023 100644 --- a/src/Tomas.Common/OSConsts.cs +++ b/src/Tomas.Kernel/OSConsts.cs @@ -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 { diff --git a/src/Tomas.Common/Terminal.cs b/src/Tomas.Kernel/Terminal.cs similarity index 58% rename from src/Tomas.Common/Terminal.cs rename to src/Tomas.Kernel/Terminal.cs index ca0f1b1..1ce8923 100644 --- a/src/Tomas.Common/Terminal.cs +++ b/src/Tomas.Kernel/Terminal.cs @@ -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) { diff --git a/src/Tomas.Kernel/TerminalCancelEventArgs.cs b/src/Tomas.Kernel/TerminalCancelEventArgs.cs new file mode 100644 index 0000000..26acf12 --- /dev/null +++ b/src/Tomas.Kernel/TerminalCancelEventArgs.cs @@ -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; } + } +}