Here is a very simple example using the method described earlier by argumentum. Note the use of static variables. Doing it that way prevents the need to define those variables as Global.
The example script sets up Ctrl+w and Ctrl+j as hotkeys to show how the method can be used for multiple hotkeys. The payload in each hotkey function will only execute if the hotkey is fired twice within the specified time, which in this case is 500 milliseconds (.5 seconds). Press ESC to exit the example.
#include <Constants.au3>
#include <Misc.au3>
;Declare constants
Const $DOUBLE_CLICK_TIME = 500
;Declare global vars
Global $ghUserDll = DllOpen("user32.dll"), _
$ghCtrlWTimer = TimerInit(), _
$ghCtrlJTimer = TimerInit()
;Set hotkey(s)
HotKeySet("^w", do_ctrl_w)
HotKeySet("^j", do_ctrl_j)
;Loop until ESC pressed
While 1
If _IsPressed("1B", $ghUserDll) then ExitLoop
WEnd
;==========================================================================
; These hotkey functions only do something if called twice within a
; specified time ($DOUBLE_CLICK_TIME)
;==========================================================================
Func do_ctrl_w()
;Declare vars
Static $iPrevTime = 0
Local $iCurrTime = TimerDiff($ghCtrlWTimer)
;If function called twice within specified time
If $iCurrTime < ($iPrevTime + $DOUBLE_CLICK_TIME) Then
;Do something
MsgBox($MB_ICONINFORMATION, "INFO", "CTRL+W double click occurred.")
;Reset timer
$ghCtrlWTimer = TimerInit()
EndIf
;Reset previous Time to current time
$iPrevTime = TimerDiff($ghCtrlWTimer)
EndFunc
Func do_ctrl_j()
;Declare vars
Static $iPrevTime = 0
Local $iCurrTime = TimerDiff($ghCtrlJTimer)
;If function called twice within specified time
If $iCurrTime < ($iPrevTime + $DOUBLE_CLICK_TIME) Then
;Do something
MsgBox($MB_ICONINFORMATION, "INFO", "CTRL+J double click occurred.")
;Reset timer
$ghCtrlJTimer = TimerInit()
EndIf
;Reset previous Time to current time
$iPrevTime = TimerDiff($ghCtrlJTimer)
EndFunc