Hi everyone,
I would like to share a simple snippet where I use for my hotkey script.
I was searching for a solution whereby pressing a same key, I could have different outcome according to the way the key is being pressed.
1) Double tap/press fast (like double click the mouse) - outcome A
2) Long press or HOLD for awhile (2-4 sec) - outcome B
#Include <Timers.au3>
Global $interval_timer, $counter
HotKeySet("{F10}", "_terminate")
#Include <Timers.au3>
Global $interval_timer, $counter
HotKeySet("{F10}", "_terminate")
HotKeySet("{F11}", "_ExitScript")
Func _ExitScript()
Exit
EndFunc
While 1
Sleep(10)
If $counter = 1 And _Timer_Diff($interval_timer) >= 550 Then
MsgBox("","","single press detected")
$counter = 0
$interval_timer = _Timer_Init()
EndIf
WEnd
Func _terminate()
Local $itv_timer