Posts: 4
Threads: 1
Joined: Sep 2012
I'd like to create a macro that does one thing if I single press a keyboard key and another if a double press. So if I map the macro to the insert key and press it once it sends the F1 key and if I tap the insert key twice with in a .4 millisecond time range it sends the F2. Any suggestions how to accomplish this? I've tried several different programs and haven't found one that works.
Posts: 12,087
Threads: 142
Joined: Dec 2002
Macro
Macro1816
Trigger
I
int+ g_InsertKeyTime; int isDouble=GetTickCount-g_InsertKeyTime<=400; g_InsertKeyTime=GetTickCount
if isDouble
,out "double"
else
,out "single"
EDIT: There is a better version:
Detecting double tap of keyboard triggers
Posts: 4
Threads: 1
Joined: Sep 2012
Wow thanks for the quick response! The macro seems to output "single" AND "double" when double tapping Insert. Anyway to make it only output "double" on a double tap and "single" on a single tap?
Posts: 12,087
Threads: 142
Joined: Dec 2002
It is more difficult. The single-tap macro would run with 0.4 s delay. If it is OK, I'll try to create such thing.
Posts: 4
Threads: 1
Joined: Sep 2012
So you'd need to have the macro wait for .4 seconds to see if another insert press occurs, that makes sense. Yes that would work nicely.
Posts: 12,087
Threads: 142
Joined: Dec 2002
Posts: 4
Threads: 1
Joined: Sep 2012
This is perfect. Thank you!