Ejemplo n.º 1
0
        private void Form_Main_KeyDown(object sender, KeyEventArgs e)
        {
            this.Focus();
            MapPanel.Focus();
            if (PressedKeys.Contains(e.KeyCode) == false)
            {
                PressedKeys.Add(e.KeyCode);
            }
            foreach (Keys k in PressedKeys)
            {
                switch (k)
                {
                case Keys.W:    //按下W键的行为
                    MyMapEditor.UpMapSeIndex();
                    break;

                case Keys.A:    //按下A键的行为
                    MyMapEditor.LeftMapSeIndex();
                    break;

                case Keys.S:    //按下W键的行为
                    MyMapEditor.DownMapSeIndex();
                    break;

                case Keys.D:    //按下A键的行为
                    MyMapEditor.RightMapSeIndex();
                    break;

                case Keys.M:
                    适应屏幕ToolStripMenuItem_Click(null, null);
                    break;

                case Keys.D1:
                case Keys.D2:
                case Keys.D3:
                case Keys.D4:
                case Keys.D5:
                case Keys.D6:
                case Keys.D7:
                case Keys.D8:
                case Keys.D9:
                case Keys.D0:
                    new QuickPlaceKey(MyMapEditor).KeyNumQuickPlace(k);
                    MapPlaceCom();
                    break;
                }
            }
            MapPanel.Refresh();
        }