仅在单独按下按键时发送

时间:2017-05-31 22:16:13

标签: autohotkey

我想将我的Windows密钥重新映射到其他内容,但我还想保留所有基于Windows密钥的快捷方式。

在伪代码中,它将是这样的:

when LWin Down until LWin Up if not LWin down abort else execute command

1 个答案:

答案 0 :(得分:3)

在按下它后的0.3秒内释放左窗口键,做其他事情(例如发送一个):

~LWin::
KeyWait, LWin
return

~LWin Up::
Send {LWin Up}
If (A_PriorHotKey = "~LWin" AND A_TimeSincePriorHotkey < 300)
    Send, a
; else  ; another action after long press (not recommendet)
    ; Send, b
return

修改

试试这个:

LWin up::
If (A_PriorKey = "LWin")
    Send a
return

; In this case its necessary to define a custom combination by using "&" or "<#" 
; to avoid that LWin loses its original function as a modifier key:

<#d:: Send #d  ; <# means LWin