Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
delay macro for "A" key on my keyboard
#1
Hello everyone, I am hoping some of you could give me some help if this is even possible. I have used QM before but have never writted code. I would like to have an adjustable delay for the A key on my keyboard. I would like to be able to turn this by hitting say F1 and turn off by F2. So i will try to explain better: with the macro running when I hit the A key it would delay to stroke and I need to be able to change the amount of delay also. I have a drag racing simulator that I am trying to basicially create a reaction time delay that I can change. At full throttle I hit the "A" key to leave the starting line. the format if you will for the reaction time in numbers is 0.0000 being a perfect light. If I red light then it may be similar to this -0.0145 or something of that nature.

Sorry for the long explaination haha. So is it possible to create something like that? I also have yahoo messenger if thats easier to get some help? If someone has any ideas would you be so kind as to post the code in here for me?

Thank you for your help
Tim
#2
store delay in a global variable and use the variable in wait command.

F1 macro:
double+ g_Adelay=0.5

F2 macro:
double+ g_Adelay=0

main macro:
double+ g_Adelay
wait g_Adelay
...
#3
Sorry but i am not smart on this at all but wanting to learn. So can I copy and paste this in? I want to be sure I was clear on what i am looking to do:

I want to I think its called "trigger" the macro on and off with the F1 enable the macro and F2 disable the macro, so when I am in my game here is what I want to do. Hit F1 to trigger on the macro, then when I hit the A on my keyboard it would be a delay before the keystoke is recognized, so when i hit it, there would be a delay of 0.0155 or something like that. but I want to be able to open the macro and change it to say 0.0032 or 0.0105 or 0.0142 or any amount i want for the delay on the A key of the key board. So basically when the macro is running anytime I hit the A key on the keyboard it would be delayed by the amount I would have pre set in the marco.

Hope I was making sense with that? lol

Thank you Smile
#4
Create macro. Assign trigger A that would work only in that program (game). 'Eat' must be checked in Properties. Code:
wait 0.015 ;;edit the number
key a

Create another two macros. Assign triggers F1 and F2.
F1 macro code:
dis- "name of the first macro" ;;enables the macro

F2 macro code:
dis+ "name of the first macro" ;;disables the macro


Attached Files
.qml   game.qml (Size: 390 bytes / Downloads: 294)
#5
Wow thank you for the code and it works just like I asked for Smile

Now I have a problem i didnt think about, cause i have to hold down the A key and wait for the delay, is it possible to make it to where I can just Tap the A key then the delay starts and then it will recognize the A stroke after the delay?
#6
In notepad it works like you need. Maybe in the game it is different, ie it not receives the A key pressed by the macro, then I don't know what to do.


Forum Jump:


Users browsing this thread: 1 Guest(s)