我想制作一个AutoHotKey脚本,其中发生以下事情,按下Win + Space时。
我知道如何做所有这些事情,除了在Win + Space之后检测下一次击键。
您可以使用内置变量A_PriorHotKey和A_TimeSincePriorHotkey来检测Win + Space之后的下一次击键,并检查最近是否按下了热键(否则可能会在几小时后激活):
#Space:: return
; The #If directive creates context-sensitive hotkeys:
#If (A_PriorHotKey = "#Space" AND A_TimeSincePriorHotkey < 2000)
; If the hotkey was pressed recently (2 seconds)
; and g is pressed, then open google:
g:: Run https://www.google.com ; open google (duh)
#If ; turn of context sensitivity