一个简单的代码,我用来切换一些东西。我目前正在尝试让这个脚本在像Fallout4这样的游戏上只在它存在的情况下工作。当它在该窗口上失去焦点时自动暂停。
*RButton::
*Control::
*Shift::
while (GetKeyState("Ctrl", "T") ^ GetKeyState("Shift", "T"))
{
while (GetKeyState("RButton", "P"))
{
;Some Action
}
;Some Action
return
}
return
*F8::Suspend
*F9::Exitapp
SetTitleMatchMode, 2
#IfWinActive SomeApplication.exe
;Run This Script
#IfWinNotActive SomeApplication.exe
;Suspend+Pause This Script
return
Exit:
ExitApp
Return我很难让这个部分在Fallout4上工作,它根本检测不到它,但在记事本上工作得很好,但我必须在#IfWinActive之后手动执行这个部分
SetTitleMatchMode, 2
#IfWinActive ahk_exe Fallout4.exe
;Run THIS Script
#IfWinNotActive ahk_exe Fallout4.exe
;Suspend+Pause This Script发布于 2019-12-20 06:18:10
在这种情况下,您只需使用#IfWinActive指令使热键与上下文相关,也就是说,只有在定义的窗口处于活动状态时才能使用它们:
#IfWinActive ahk_exe Fallout4.exe
*RButton::
*Control::
*Shift::
while (GetKeyState("Ctrl", "T") ^ GetKeyState("Shift", "T"))
{
while (GetKeyState("RButton", "P"))
{
;Some Action
}
;Some Action
return
}
return
*F8::Suspend
*F9::Exitapp
#IfWinActive ; turn off context sensitivityhttps://stackoverflow.com/questions/59417159
复制相似问题