Example #1
0
        void OnKeyPressed(object sender, KeyEventArgs args)
        {
            switch (args.KeyCode)
            {
            case Keys.Enter:
                if (!DevConsole.IsActivated)
                {
                    State = ScreenState.ChangeNext;
                }
                break;

            case Keys.P:
            case Keys.Back:
                if (!DevConsole.IsActivated)
                {
                    State = ScreenState.ChangePrevious;
                }
                break;

            case DevConsole.ACTIVATION_KEY:
                if (DevConsole.IsActivated)
                {
                    DevConsole.Deactivate();
                }
                else
                {
                    DevConsole.Activate();
                }
                break;
            }
        }
Example #2
0
        void KeyboardEventDispatcher_OnKeyPressed(object sender, KeyEventArgs args)
        {
            switch (args.KeyCode)
            {
            case DevConsole.ACTIVATION_KEY:
                if (DevConsole.IsActivated)
                {
                    DevConsole.Deactivate();
                }
                else
                {
                    DevConsole.Activate();
                }
                break;

            case Keys.N:
                if (!DevConsole.IsActivated)
                {
                    LoadUnit(unitDataFiles[curUnit]);
                    curUnit = (curUnit + 1) % unitDataFiles.Count;
                }
                break;

            case Keys.P:
                if (!DevConsole.IsActivated)
                {
                    State = ScreenState.ChangePrevious;
                }
                break;

            case Keys.Escape:
                State = ScreenState.ExitApplication;
                break;
            }
        }
Example #3
0
        public void OnKP(object s, KeyEventArgs a)
        {
            switch (a.KeyCode)
            {
            case Keys.P:
                if (!DevConsole.IsActivated)
                {
                    pauseEngine = !pauseEngine;
                }
                break;

            case Keys.O:
                if (!DevConsole.IsActivated)
                {
                    pauseRender = !pauseRender;
                }
                break;

            case DevConsole.ACTIVATION_KEY:
                if (DevConsole.IsActivated)
                {
                    DevConsole.Deactivate();
                }
                else
                {
                    DevConsole.Activate();
                }
                break;

            case Keys.Escape:
                State = ScreenState.ChangePrevious;
                break;

            case Keys.Enter:
                Texture2D t = System.Threading.Interlocked.Exchange(ref tPopup, null);
                if (t != null)
                {
                    t.Dispose();
                }
                pauseEngine = false;
                break;
            }
        }