如何解决在其重新映射中发送组合键不起作用 AHK
我制作了一个 AHK 脚本,用于在 AHK 中编译我的键盘布局,将其移动到 Windows 10 启动文件夹,然后运行它。当我运行脚本并按下组合键时,它确实运行了,并且除了 Ctrl + F7 的初始发送外,一切都在运行,它应该在我的编辑器中编译脚本。我已经尝试了一些东西,但到目前为止还没有奏效。感谢您的帮助,我已附上下面的代码。
#IfWinActive,ahk_class SciTEWindow ;if script editor is open
$<^F7:: ;if ctrl+F7 is pressed
Sleep,200 ;wait a 0.2 seconds
Send {^F7} ;send ctrl+F7 to compile script (this line isn't working)
Sleep,2000 ;wait 2 seconds for the script to compile
Filecopy,C:\Users\jackn\Typing\Key Mappings\Startup Folder Layouts\keymap.exe,C:\Users\jackn\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup,1 ;copies the file to the startup folder
Sleep,100;waits 0.1 seconds
run,C:\Users\jackn\Typing\Key Mappings\Startup Folder Layouts\keymap.exe ;runs the program
return
return
解决方法
代替
Send {^F7}
使用
Send ^{F7}
完整脚本:
#IfWinActive,ahk_class SciTEWindow ;if script editor is open
$<^F7:: ;if ctrl+F7 is pressed
Sleep,200 ;wait a 0.2 seconds
Send ^{F7} ;send ctrl+F7 to compile script (this line has been changed)
Sleep,2000 ;wait 2 seconds for the script to compile
FileCopy,C:\Users\jackn\Typing\Key Mappings\Startup Folder Layouts\keymap.exe,C:\Users\jackn\AppData\Roaming\Microsoft\Windows\Start Menu\Programs\Startup,1 ;Copies the file to the startup folder
Sleep,100;waits 0.1 seconds
run,C:\Users\jackn\Typing\Key Mappings\Startup Folder Layouts\keymap.exe ;runs the program
return
return
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。