Windows 10 中的 AutoHotkey - 热键在某些应用程序中不起作用

AutoHotkey in Windows 10 - Hotkeys not working in some applications

这样的简单脚本
a::msgbox hi!

以前在 Windows 7 下工作正常。现在我升级到 Windows 10,当某些 windows 处于活动状态时它不工作。特别是 LButton-热键可以搞乱一切,导致您实际上需要任务管理器的情况。

这是一小部分应用程序,其中热键不再被识别:(相反,从上面的脚本开始,一个简单的a 已发送)

它在哪里起作用:(示例)

有人可以重现吗?

Win10 中的 AutoHotkey 有什么问题?

如何解决这个问题?

(AHKscript 版本 1.1.22.3 Unicode 64 位)

由于 Windows 10 刚刚发布,这是一个非常相关的问题,我相信很多用户会感谢帮助让他们的脚本在这个新 [=29] 上正确地 运行 =].可能有人认为这个问题的范围太广或者分类不当,因为它是一个 Windows 问题而不是一个特定的 AutoHotkey 问题?

据我了解,问题在于新的 UAC 设置。一个简单的解决方案是 运行 您的脚本作为管理员。为此,右键单击文件 -> select "Run as Administrator"

编辑:

关于 运行始终以管理员身份管理应用程序或文件(在 Windows 10 中),我没有直接的答案,但我发现的本指南似乎涵盖了所有方面可以在 Windows 10 内完成。

http://www.tenforums.com/tutorials/3436-run-administrator-windows-10-a.html

另一种方法是让脚本检查它是否 运行正在以管理员身份运行,如果不是以管理员身份重新加载。代码是从帮助文件中提取的:

if not A_IsAdmin
{
   Run *RunAs "%A_ScriptFullPath%"  ; Requires v1.0.92.01+
   ExitApp
}

检查 "run this program as administrator" 在:

autohothey.exe > properties > compatability > settings

Everything Search Engine 也不适合我。

以前,将 .ahk 脚本编译为 .exe 可以解决任何问题。

Windows10又出问题了

以下信息帮助我修复了它:

On Windows 8 and later, UAC can only be disabled by modifying the registry, and doing so breaks apps.

As I said, "turning off" UAC in Control Panel on Windows 8 and later just suppresses the Yes/No prompts; programs are still run with limited privileges by default.

https://autohotkey.com/boards/viewtopic.php?t=9770

disable UAC via the registry, you’ll need to head to the start menu search box and type in regedit.exe and browse down to the following key:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System

Over on the right-hand side, you should see a setting for EnableLUA, which you’ll want to customize as follows:

UAC Enabled: 1
UAC Disabled: 0

http://www.howtogeek.com/howto/4820/how-to-really-completely-disable-uac-on-windows-7/

也在 howtogeek 页面上:

Just download, extract, and double-click on the included ReallyDisableUAC-Win7.reg file to disable UAC.

You’ll need to reboot for the setting to actually take effect.

There’s also an included registry hack file to re-enable it as well.


  • Disable UAC completely. As you noted, this will kill apps on Windows 10 (or 8).

  • Create a patched executable using EnableUIAccess, and then use that executable to run the script.

https://autohotkey.com/board/topic/148522-sendplay-windows-10-trouble/

尝试以管理员权限启动您的 exe(即右键单击您的 exe,然后 运行 以管理员身份)。

而不是 运行使用通常的 AutoHotKey 设置脚本:

click right -> Run with UI Access

要始终 运行 具有 UI 访问权限,请将 运行 脚本的默认应用更改为:

"C:\Program Files\AutoHotkey\AutoHotkeyU64_UIA.exe"

或者:

"C:\Program Files\AutoHotkey\AutoHotkeyU_UIA.exe"