在其重新映射中发送组合键不起作用 AHK

Sending the key combination within its remap not working AHK

我制作了一个 AHK 脚本,用于在 AHK 中编译我的键盘布局,将其移动到 Windows 10 启动文件夹,然后 运行s 它。当我 运行 脚本并按下组合键时,它会执行 运行,除初始发送 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