Press and Hold "e" until any key pressed
Press and Hold "e" until any key pressed
Hey guys. Looking for a script that when I press "F1" it sends "e" and holds it down until any other key is pressed. Can't figure out the "any other key is pressed" part. I have one script that holds "e" key but it only releases it when the same key is pressed.
Re: Press and Hold "e" until any key pressed
Hallo,
try:or with AutoRepeat of key E:
try:
Code: Select all
Hotkey, IF, AnyKey
For all, LF in [[0x1FF,"sc{:X}"],[0xFE,"vk{:X}"]]
Loop,% LF.1
IF (""<Key:=GetKeyName(Format(LF.2, A_Index)))
Hotkey, ~*%Key%, AnyKey
Return
#IF !AnyKey
F1::
Send, {e Down}
ToolTip, e Down ; for Test only
AnyKey := True
KeyWait, F1
Return
#IF AnyKey
AnyKey:
AnyKey := False
Send, {e Up}
ToolTip ; for Test only
Return
#IF
Code: Select all
Hotkey, IF, AnyKey
For all, LF in [[0x1FF,"sc{:X}"],[0xFE,"vk{:X}"]]
Loop,% LF.1
IF (""<Key:=GetKeyName(Format(LF.2, A_Index)))
Hotkey, ~*%Key%, AnyKey
Return
#IF !AnyKey
F1::
SetTimer, e Up, 30
AnyKey := True
KeyWait, F1
Return
#IF AnyKey
e Up::Send, {e Down}
AnyKey:
SetTimer, e Up, Off
AnyKey := False
Send, {e Up}
Return
#IF
Re: Press and Hold "e" until any key pressed
@Rohwedder
This works perfectly!!!!! Thanks you so much
This works perfectly!!!!! Thanks you so much
Who is online
Users browsing this forum: Rookieahk and 50 guests