コード例 #1
0
        protected override void OnKeyDown(KeyEventArgs e)
        {
            base.OnKeyDown(e);

            if (!_viewModel.IsMapLoaded)
            {
                return;
            }

            switch (e.KeyCode)
            {
            case Keys.Up:
                _viewModel.MoveUp();
                break;

            case Keys.Down:
                _viewModel.ModeDown();
                break;

            case Keys.Left:
                _viewModel.MoveLeft();
                break;

            case Keys.Right:
                _viewModel.MoveRight();
                break;
            }
        }