Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Double tap vs single tap a key
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.
Macro Macro1816
Trigger I     Help - how to add the trigger to the macro
Copy      Help
int+ g_InsertKeyTime; int isDouble=GetTickCount-g_InsertKeyTime<=400; g_InsertKeyTime=GetTickCount

if isDouble
,out "double"
,out "single"

EDIT: There is a better version: Detecting double tap of keyboard triggers
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?
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.
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.
Detecting double tap of keyboard triggers
This is perfect. Thank you!

Forum Jump:

Users browsing this thread: 1 Guest(s)