I'm attempting to execute some WPF commands with help of WPF KeyGesture class. Application works fine until I specify a key combination consisting of Shift modifier and an alphanumeric key. For example, following instantiation: new KeyGesture(Key.M, ModifierKeys.Shift)
throws an exception:
'Shift+M' key and modifier combination is not supported for KeyGesture.
Bare Shift modifier won't work with numbers too (e.g. Shift+2
). However, Shift+Insert
or Shift+F1
combinations work flawlessly. Just to put it clear, there are no problems with Shift+Control
, Shift+Alt
or Alt+1
and alike.
Why was a decision made to forbid Shift+[Alphanumeric] gesture? Does it have anything in common with typing capital letters? Is there a workaround coherent with the WPF commanding system? (Note: I'm not trying to use a Shift+M gesture, while filling textboxes, but rather when no textbox is in focus.)
I seem to find only one forum entry, where this issue is raised. A documentation search failed. Is it so obvious for developers to avoid Shift+[Alpha/Num]
?