问题描述
我使用 AutoHotKey 重新映射了菜单键和其他字母数字键的一些组合,但这样做会禁用菜单键的正常使用。有没有办法可以重新映射键的组合,但将其正常使用与 AHK 相同。我将把我目前正在使用的代码放在下面。谢谢
AppsKey & m::DllCall("SetCursorPos","int",2000,1440) ; The first number is the X-coordinate and the second is the Y (relative to the screen).
AppsKey & =:: Send {U+2248}
AppsKey & x:: Send {U+00D7}
解决方法
从 docs that user3419297 mentioned 开始,您可以通过将 AppsKey::AppsKey
放在脚本末尾来解决此问题。但是,这将导致菜单键仅在您释放菜单键后才能执行其正常功能,前提是您在此期间没有按下任何其他键(与您最初按下时相反) )。如果这种功能变化没有发生,那么每次尝试按住菜单键以触发任何热键时,都会触发菜单键的标准功能。
最终脚本
AppsKey & m::DllCall("SetCursorPos","int",2000,1440) ; The first number is the X-coordinate and the second is the Y (relative to the screen).
AppsKey & =:: Send {U+2248}
AppsKey & x:: Send {U+00D7}
AppsKey::AppsKey