0

我希望能够运行.exe启动游戏,禁用 Alt-Tab 的使用(最好仅在游戏处于焦点时),然后等待我手动退出游戏,然后终止脚本。

到目前为止,我只有

run C:\Program Files (x86)\Steam\steamapps\common\Counter-Strike Global Offensive

!Tab::return

但是我似乎无法弄清楚如何仅在屏幕专注于游戏时才禁用它,或者如何等待我关闭游戏后再重新启用它。

此外,我不完全确定这是否允许我在玩游戏时使用标签。我希望能够同时按 ALT 和 TAB,因为它们都有功能,只是不切换窗口。

4

1 回答 1

1

这是我将如何做到的。正如 MLC 所说,使用#ifWinActive

;run your program, save the proccess ID
Run, notepad, , , thePid
;add that process to a group
GroupAdd, blockAltTab, % "ahk_pid " thePid
;wait for the process to close and exit
Process, waitClose, %thePid%
ExitApp

;if a window from the blockAltTab group is in the foreground then block alt+tab
#IfWinActive, ahk_group blockAltTab
!Tab::return
;clear the blockAltTab group restriction for any other hotkeys
#IfWinActive
于 2013-09-27T04:31:53.683 回答