I want to create my custom command and to hook it up to some key.
I am using KeyGesture in code behing for that purpose , and in the constructor I see that I can pass only one key (without modifierKey) but at runtime I get exception , saying :
"'None + Q' key and modifier combination is not supported for KeyGesture"
I just don’t understand why there is a constructor for only one key and still I need to set also the modifier key combination in order not to get the exception.
Pasted from the MSDN:
The problem with “normal” keys is to distinguish an actual button press from a shortcut. For example if you have a textbox, you can’t use a command with the gesture Q to do something differently than inserting the character Q. If you want something like that use the KeyDown/Up commands and your own command invocation.