Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Double tap vs single tap a key
#1
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.
#2
Macro Macro1816
Trigger I     Help - how to add the trigger to the macro
Code:
Copy      Help
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
#3
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?
#4
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.
#5
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.
#6
Detecting double tap of keyboard triggers
#7
This is perfect. Thank you!


Forum Jump:


Users browsing this thread: 1 Guest(s)