public static void Process() { int lastSecond = -1; Console.BackgroundColor = Colors.Black; Console.Goto(21, 0); Console.Color = Colors.White; Console.Write("> "); Mosa.DeviceDriver.ScanCodeMap.US KBDMAP = new DeviceDriver.ScanCodeMap.US(); while (true) { byte scancode = Setup.Keyboard.GetScanCode(); if (scancode != 0) { // Debug.Trace("Main.Main Key Scan Code: " + scancode.ToString()); KeyEvent keyevent = KBDMAP.ConvertScanCode(scancode); // Debug.Trace("Main.Main Key Character: " + keyevent.Character.ToString()); if (keyevent.KeyPress == KeyEvent.Press.Make) { if (keyevent.Character != 0) { Console.Write(keyevent.Character); } if (keyevent.KeyType == KeyType.F1) { ConsoleManager.Controller.Active = ConsoleManager.Controller.Boot; } else if (keyevent.KeyType == KeyType.F2) { ConsoleManager.Controller.Active = ConsoleManager.Controller.Debug; } } // Debug.Trace("Main.Main Key Character: " + ((uint)keyevent.Character).ToString()); } if (Setup.CMOS.Second != lastSecond) { //DebugClient.SendAlive(); lastSecond = Setup.CMOS.Second; //Debug.Trace("Main.Main Ping Alive"); } //DebugClient.Process(); Native.Hlt(); } }
public static void Process() { int lastSecond = -1; Console.SetCursor(0, 3); Console.Write("> "); Mosa.DeviceDriver.ScanCodeMap.US KBDMAP = new DeviceDriver.ScanCodeMap.US(); while (true) { byte scancode = Setup.Keyboard.GetScanCode(); if (scancode != 0) { // Debug.Trace("Main.Main Key Scan Code: " + scancode.ToString()); KeyEvent keyevent = KBDMAP.ConvertScanCode(scancode); // Debug.Trace("Main.Main Key Character: " + keyevent.Character.ToString()); if (keyevent.KeyPress == KeyEvent.Press.Make) { if (keyevent.Character != 0) { Console.Write(keyevent.Character); } if (keyevent.KeyType == KeyType.F1) ConsoleManager.Controller.Active = ConsoleManager.Controller.Boot; else if (keyevent.KeyType == KeyType.F2) ConsoleManager.Controller.Active = ConsoleManager.Controller.Debug; } // Debug.Trace("Main.Main Key Character: " + ((uint)keyevent.Character).ToString()); } if (Setup.CMOS.Second != lastSecond) { //DebugClient.SendAlive(); lastSecond = Setup.CMOS.Second; //Debug.Trace("Main.Main Ping Alive"); } //DebugClient.Process(); Native.Hlt(); } }