如何在WPF中绑定Ctrl和数字键盘/(正斜杠)? [英] How can I bind Ctrl and the Number Pad / (forward slash) in WPF?
本文介绍了如何在WPF中绑定Ctrl和数字键盘/(正斜杠)?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我希望能够对 Ctrl +/
进行键盘绑定.但不是与?
(在主键盘上)相同的键上的/
.我想在/
的数字键盘上执行此操作.
I want to be able to do a KeyBinding on Ctrl+/
. But not the /
that is on the same key as the ?
(on the main keyboard). I want to do it on the number pad key of /
.
要使其与主键盘配合使用,请执行以下操作:
To make it work with the main keyboard / this works:
<KeyBinding Command="{Binding ElementName=window, DataContext.KeyBindingCommand}"
CommandParameter="{Binding Gesture, RelativeSource Self}}"
Gesture="CTRL+Question"
它之所以使用Question,是因为它在按下控件时会得到偏移的值(我想).
It uses Question because it gets the shifted value when control is pressed (I guess).
但这不适用于小键盘的/
键.
But that does not work for the numpad /
key.
查看全文