Beispiel #1
0
 protected override void KeyDownHandler(object sender, KeyboardKeyEventArgs args)
 {
     key_down[args.Key] = true;
     if (!Global.KeyPressed)
     {
         ConsoleKey ck = Global.GetConsoleKey(args.Key);
         if (ck != ConsoleKey.NoName)
         {
             bool alt   = KeyIsDown(Key.LAlt) || KeyIsDown(Key.RAlt);
             bool shift = KeyIsDown(Key.LShift) || KeyIsDown(Key.RShift);
             bool ctrl  = KeyIsDown(Key.LControl) || KeyIsDown(Key.RControl);
             if (ck == ConsoleKey.Enter && alt)
             {
                 if (FullScreen)
                 {
                     FullScreen  = false;
                     WindowState = WindowState.Normal;
                 }
                 else
                 {
                     FullScreen  = true;
                     WindowState = WindowState.Fullscreen;
                 }
             }
             else
             {
                 Global.KeyPressed = true;
                 Global.LastKey    = new ConsoleKeyInfo(Global.GetChar(ck, shift), ck, shift, alt, ctrl);
             }
         }
         MouseUI.RemoveHighlight();
         MouseUI.RemoveMouseover();
     }
 }