如何检测 AutoHotKey 中的热键后的下一个按键

How do I detect the next keypress after a hotkey in AutoHotKey

我想制作一个 AutoHotKey 脚本,其中发生以下事情,按 Win+Space 时的顺序.

我知道如何做所有这些事情,除了检测下一次击键 after Win+Space.

您可以使用 built-in 变量 A_PriorHotKeyA_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

https://autohotkey.com/docs/commands/_If.htm