如何禁用特定的 Windows 键盘快捷键?

如何禁用特定的 Windows 键盘快捷键?

我很难找到这么简单问题的答案。我想禁用F10打开菜单的快捷方式。出于某种原因,这似乎是不可能的。

想要F10完全禁用 - 就像使用 AutoHotKey 一样。

是否有任何 Windows 内置方法来编辑操作系统键盘快捷键?如果没有,那似乎很疯狂……

使用 Windows 10。

答案1

Windows 上没有内置的方法来执行此操作。每个应用程序都处理自己的键盘快捷键。您的应用程序可能可以通过某种方式配置来禁用 F10,但大多数程序不提供这种级别的自定义。

AutoHotkey 可以配置为当特定应用程序或窗口处于活动状态时阻止按键/快捷方式

这是我刚刚编写的用于在 Chrome 中专门阻止 F1 的有效 AHK 示例脚本。

#NoEnv  ; Recommended for performance and compatibility with future AutoHotkey releases.
; #Warn  ; Enable warnings to assist with detecting common errors.
SendMode Input  ; Recommended for new scripts due to its superior speed and reliability.
SetWorkingDir %A_ScriptDir%  ; Ensures a consistent starting directory.
#SingleInstance, force

#IfWinActive, ahk_exe chrome.exe

    F1::
    Return

#If

答案2

应该明确快捷方式的范围,特别是谁应该处理快捷方式。

对于一般建议 - 通过程序 A 禁用全局快捷键处理,通过程序 B 启用处理。

  1. 使用 AHK(autohotkey) - 程序 C,通过以下方式将此快捷键注册为全局快捷键:身体的

  2. 然后Send使用重发 模拟快捷方式积极的窗户,好像没有全球的快捷方式。
    或者ControlSend使用重定向特别的窗口B,好像B处理这个快捷方式全球

$+^F10::Send +^{F10}
$+^F11::ControlSend ,,+^{F11},B

相关内容