Disabling (or capturing) CTRL+A in SyntaxEditor

SyntaxEditor for WPF Forum

Posted 6 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 6 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 6 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 (v2019.1 build 0684) was released 17 days ago, which was after the last post in this thread.

Add Comment

Please log in to a validated account to post comments.