【发布时间】:2019-09-12 07:08:18
【问题描述】:
我想防止组合键 Window+D 使用 xaml。
<Window.InputBindings>
<KeyBinding Modifiers="Alt" Key="F10" Command="{Binding CommandAltF10}"></KeyBinding>
<KeyBinding Modifiers="Windows" Key="D" Command="{Binding CommandWindowD}"></KeyBinding>
</Window.InputBindings>
第一个组合有效。当我按下Alt+F10 键时,CommandAltf10 命令正在触发。
但是当我按下Window+D 键时,它不会触发CommandWindowD 命令。为什么它不起作用?
【问题讨论】:
-
该组合通常已经注册以最小化所有窗口并显示桌面。
-
来自docs:涉及WINDOWS键的键盘快捷键保留供操作系统使用,因此您不能使用本机
RegisterHotKeyAPI覆盖这些,甚至更少KeyBinding。