更新时间:2023-02-26 13:40:04
例如,您可以覆盖窗口的 OnPreviewKeyDown
方法,例如:
You could for example override the OnPreviewKeyDown
method of your window, e.g.:
protected override void OnPreviewKeyDown(KeyEventArgs e)
{
base.OnPreviewKeyDown(e);
if (e.Key == Key.B)
{
//...
}
}