开发者

KeyGesture not accepting a Shift+Alphanumeric key combination

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, Modifier开发者_JAVA百科Keys.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 + Ctrl, 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 + [Alphanumeric]?


See SO 8251043 - basically it's no longer a "gesture" its a keybinding Create a simple, unmodified key binding in WPF

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜