必须重新加载 AHK 脚本,尽管它在启动文件夹中
Have to reload AHK Script despite it being in startup folder
我有一个 AHK 脚本可以将我的鼠标中键重新映射为 Delete 键。我已将此脚本连同我的其他脚本添加到 shell:startup
找到的启动文件夹中。但是,即使在启动时自动加载此脚本,它也无法正常工作。为了让它工作,我再次需要通过在您右键单击系统托盘中的脚本图标时选择 Reload this script
选项来重新加载它。只有在重新加载脚本后映射才能正常工作。我可以更改什么以使脚本在第一次加载时像我所有其他脚本一样工作?
这是脚本本身(足够简单...)
#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.
MButton::Delete
@Iww 成功回答了评论中的问题
问题是 shell:startup 目录中的自动热键脚本快捷方式过多。将每个脚本作为 #Include [directory][script].ahk 放入一个主脚本中,并在 shell:startup 中仅放置一个主脚本的快捷方式就可以了。
我有一个 AHK 脚本可以将我的鼠标中键重新映射为 Delete 键。我已将此脚本连同我的其他脚本添加到 shell:startup
找到的启动文件夹中。但是,即使在启动时自动加载此脚本,它也无法正常工作。为了让它工作,我再次需要通过在您右键单击系统托盘中的脚本图标时选择 Reload this script
选项来重新加载它。只有在重新加载脚本后映射才能正常工作。我可以更改什么以使脚本在第一次加载时像我所有其他脚本一样工作?
这是脚本本身(足够简单...)
#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.
MButton::Delete
@Iww 成功回答了评论中的问题
问题是 shell:startup 目录中的自动热键脚本快捷方式过多。将每个脚本作为 #Include [directory][script].ahk 放入一个主脚本中,并在 shell:startup 中仅放置一个主脚本的快捷方式就可以了。