示例#1
0
        protected override void OnKeyDown(KeyEventArgs e)
        {
            if (game != null)
            {
                game.KeyPressed(e.KeyCode);
            }
            switch (e.KeyCode)
            {
            case Keys.P:
                MainMenuStrip.Items["Pause"].PerformClick();
                break;

            case Keys.OemMinus:
                MainMenuStrip.Items["-Speed"].PerformClick();
                break;

            case Keys.Oemplus:
                MainMenuStrip.Items["+Speed"].PerformClick();
                break;
            }
        }