Disabling (or capturing) CTRL+A in SyntaxEditor

SyntaxEditor for WPF Forum

Posted 11 years ago by tal
Version: 13.2.0590
Avatar

Hey,

I wish to supply a different implementation for the SelectAll Command and I thought to implement it by capturing the CTRL+A key event (up or down).

I was unsuccessful even after unbinding the SelectAll command using:

foreach (KeyBinding item in editor.InputBindings)
{
    if ((item.Key == Key.A) && (item.Modifiers == ModifierKeys.Control))
    {
        editor.InputBindings.Remove(item);
        break;
    }
}

How can i achieve the desired effect?

Thanks,
Tal

Comments (2)

Answer - Posted 11 years ago by Actipro Software Support - Cleveland, OH, USA
Avatar

Hi Tal,

You might also have to remove EditorCommands.SelectAll from the SyntaxEditor.CommandBindings collection too.  That should do the trick since I think that command has a Ctrl+A input gesture on it as well.


Actipro Software Support

Posted 11 years ago by tal
Avatar

That still didn't fire the events for KeyDown & KeyUp (with the e.Key == Keys.A and the CTRL pressed), I decided to use CustomCommandBinding & CustomInputBinding to override the CTRL+A event and it did the trick.

Thanks!

The latest build of this product (v24.1.1) was released 2 months ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.