Exemplo n.º 1
0
        /// <summary>
        ///
        /// </summary>
        private Dictionary <Keys, Action> BindKeys()
        {
            return(new Dictionary <Keys, Action>
            {
                // カーソル移動系
                [Keys.Up] = () => _presenter.Up(),
                [Keys.Down] = () => _presenter.Down(),
                [Keys.Left] = () => _presenter.Left(),
                [Keys.Right] = () => _presenter.Right(),
                [Keys.Home] = () => _presenter.MoveLineTop(),
                [Keys.Home | Keys.Control] = () => _presenter.MoveTop(),
                [Keys.End] = () => _presenter.MoveLineEnd(),
                [Keys.End | Keys.Control] = () => _presenter.MoveEnd(),
                [Keys.PageUp] = () => _presenter.PageUp(),
                [Keys.PageDown] = () => _presenter.PageDown(),
                [Keys.Right | Keys.Control] = () => _presenter.MoveNextWord(),
                [Keys.Left | Keys.Control] = () => _presenter.MovePrevWord(),

                // カーソル移動系(選択)
                [Keys.Up | Keys.Shift] = () => _presenter.UpSelect(),
                [Keys.Down | Keys.Shift] = () => _presenter.DownSelect(),
                [Keys.Left | Keys.Shift] = () => _presenter.LeftSelect(),
                [Keys.Right | Keys.Shift] = () => _presenter.RightSelect(),
                [Keys.Home | Keys.Shift] = () => _presenter.MoveLineTopSelect(),
                [Keys.Home | Keys.Control | Keys.Shift] = () => _presenter.MoveTopSelect(),
                [Keys.End | Keys.Shift] = () => _presenter.MoveLineEndSelect(),
                [Keys.End | Keys.Control | Keys.Shift] = () => _presenter.MoveEndSelect(),
                [Keys.PageUp | Keys.Shift] = () => _presenter.PageUpSelect(),
                [Keys.PageDown | Keys.Shift] = () => _presenter.PageDownSelect(),
                [Keys.Right | Keys.Control | Keys.Shift] = () => _presenter.MoveNextWordSelect(),
                [Keys.Left | Keys.Control | Keys.Shift] = () => _presenter.MovePrevWordSelect(),

                // 編集系
                [Keys.Z | Keys.Control] = () => _presenter.Undo(),
                [Keys.Y | Keys.Control] = () => _presenter.Redo(),
                [Keys.C | Keys.Control] = () => Copy(),
                [Keys.V | Keys.Control] = () => Paste(),
                [Keys.X | Keys.Control] = () => Cut(),
                [Keys.Enter] = () => _presenter.NewLine(),
                [Keys.Delete] = () => _presenter.Delete(),
                [Keys.Back] = () => _presenter.DeleteBack(),
                [Keys.Tab] = () => _presenter.Indent(),
                [Keys.Tab | Keys.Shift] = () => _presenter.Unindent(),

                // 選択系
                [Keys.A | Keys.Control] = () => _presenter.SelectAll(),
                [Keys.Escape] = () => _presenter.ClearSelect(),

                // スクロール系
                [Keys.Up | Keys.Control] = () => _presenter.ScrollUp(),
                [Keys.Down | Keys.Control] = () => _presenter.ScrollDown(),
                [Keys.ProcessKey] = () => _presenter.ScrollCaret(), // IME入力中
            });
        }