How to specify keybinding for Commands?

SyntaxEditor for Windows Forms Forum

Posted 19 years ago by shark92651
If I add a custom EditCommand to the SyntaxEditor.CommandLinks collection, I can't seem to get the command to execute if it contains a modifier. For example, I have created a custom EditCommand to convert selected text to Upper Case. I am trying to map the key to Control+U, but it won't fire. If I map it to a single key, such as F12, it works fine.

myEditor.CommandLinks.Add(new CommandLink(new UpperCaseCommand(),
new KeyBinding(ModifierKeys.AnyControl, keys.F12)));

Any idea what I may be doing wrong?

Comments (2)

Posted 19 years ago by Actipro Software Support - Cleveland, OH, USA
I tried a similar line (just a different command) with the same setup and it worked ok here.

new CommandLink(new MyCommand(), new KeyBinding(WinUICore.Input.ModifierKeys.AnyControl, Keys.F12))

Actipro Software Support

Posted 19 years ago by shark92651
Thanks, I found I was doing something wrong on my end that had to do with the changes to the Modifiers.
The latest build of this product (v24.1.0) 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.