Thanks Nickdemar734 for bringing up the idea of counting successive strokes of the same key in a given time frame to trigger different scripts/actions. I wrote another way of doing it:
Note:
The script will display the number of times F1 has been pressed, until an interval of one second of not pressing F1 has passed.
A count of 0 will mean that the user has pressed the key (F1) while the dialog box was displayed.
PressCount := 0
F1::
PressCount := PressCount + 1
SetTimer, TimerKey, -1000
Return
TimerKey:
MsgBox % "F1 has been quickly pressed " PressCount " time"
PressCount := 0
Return
Note:
The script will display the number of times F1 has been pressed, until an interval of one second of not pressing F1 has passed.
A count of 0 will mean that the user has pressed the key (F1) while the dialog box was displayed.