protected override bool ProcessTextAreaKey(Keys keyData)
        {
            if (!Visible)
            {
                return(false);
            }

            switch (keyData)
            {
            case Keys.Back:
                --endOffset;
                if (endOffset < startOffset)
                {
                    Close();
                }
                return(false);

            case Keys.Delete:
                if (control.ActiveTextAreaControl.Caret.Offset <= endOffset)
                {
                    --endOffset;
                }
                if (endOffset < startOffset)
                {
                    Close();
                }
                return(false);

            case Keys.Home:
                codeCompletionListView.SelectIndex(0);
                return(true);

            case Keys.End:
                codeCompletionListView.SelectIndex(completionData.Length - 1);
                return(true);

            case Keys.PageDown:
                codeCompletionListView.PageDown();
                return(true);

            case Keys.PageUp:
                codeCompletionListView.PageUp();
                return(true);

            case Keys.Down:
                codeCompletionListView.SelectNextItem();
                return(true);

            case Keys.Up:
                codeCompletionListView.SelectPrevItem();
                return(true);

            case Keys.Tab:
            case Keys.Return:
                InsertSelectedItem();
                return(true);
            }
            return(base.ProcessTextAreaKey(keyData));
        }
Exemple #2
0
        protected override bool ProcessTextAreaKey(Keys keyData)
        {
            if (!Visible)
            {
                return(false);
            }

            var result = false;

            switch (keyData)
            {
            case Keys.Home:
                codeCompletionListView.SelectIndex(0);
                result = true; break;

            case Keys.End:
                codeCompletionListView.SelectIndex(completionData.Length - 1);
                result = true; break;

            case Keys.PageDown:
                codeCompletionListView.PageDown();
                result = true; break;

            case Keys.PageUp:
                codeCompletionListView.PageUp();
                result = true; break;

            case Keys.Down:
                codeCompletionListView.SelectNextItem();
                result = true; break;

            case Keys.Up:
                codeCompletionListView.SelectPrevItem();
                result = true; break;

            case Keys.Tab:
                InsertSelectedItem('\t');
                result = true; break;

            case Keys.Return:
                InsertSelectedItem('\n');
                result = true; break;
            }

            if (result)
            {
                return(true);
            }
            else
            {
                return(base.ProcessTextAreaKey(keyData));
            }
        }