コード例 #1
0
        internal void keyUp(int charCode, Keys keyData)
        {
            var s = KeySelector.Create(charCode,
                                       (keyData & Keys.Control) == Keys.Control,
                                       (keyData & Keys.Alt) == Keys.Alt,
                                       (keyData & Keys.Shift) == Keys.Shift);

            trace.keyUp(charCode, keyData);
            keyActionMap.Execute(s, ActionKeyKind.KeyUp);
        }
コード例 #2
0
        private void createKeyCommands()
        {
            attachMap.Add(KeySelector.Create(KeyCode.Down), kCaretDown);
            attachMap.Add(KeySelector.Create(KeyCode.Up), kCaretUp);
            attachMap.Add(KeySelector.Create(KeyCode.Right), kCaretForward);
            attachMap.Add(KeySelector.Create(KeyCode.Left), kCaretBackward);

            attachMap.Add(KeySelector.Create(KeyCode.PageDown), kCaretPageDown);
            attachMap.Add(KeySelector.Create(KeyCode.PageUp), kCaretPageUp);

            attachMap.Add(KeySelector.Create(KeyCode.Home), kCaretLineBegin);
            attachMap.Add(KeySelector.Create(KeyCode.End), kCaretLineEnd);

            attachMap.Add(KeySelector.Create(KeyChar.C, true, false, false), kCopySelection);
            attachMap.Add(KeySelector.Create(KeyCode.Insert, true, false, false), kCopySelection);
        }
コード例 #3
0
        public void Detach(IView target)
        {
            view.KeyMap.Remove(KeySelector.Create(KeyCode.Down, false, false, true), kCaretDown);
            view.KeyMap.Remove(KeySelector.Create(KeyCode.Up, false, false, true), kCaretUp);

            view.KeyMap.Remove(KeySelector.Create(KeyCode.PageDown, false, false, true), kCaretPageDown);
            view.KeyMap.Remove(KeySelector.Create(KeyCode.PageUp, false, false, true), kCaretPageUp);

            view.KeyMap.Remove(KeySelector.Create(KeyCode.Home, false, false, true), kCaretLineBegin);
            view.KeyMap.Remove(KeySelector.Create(KeyCode.End, false, false, true), kCaretLineEnd);

            view.KeyMap.Remove(KeySelector.Create(KeyCode.Left, false, false, true), kCaretBackwardSelection);
            view.KeyMap.Remove(KeySelector.Create(KeyCode.Right, false, false, true), kCaretForwardSelection);
            view.CaretMoved -= view_CaretMoved;

            view = null;
        }