Loop Problems

closed account (105oizwU)
Can Someone Show Me An Example Script Of How To Make A Macro: It Needs To Be Able To Press A Key every 2 seconds. its just one key, the space bar. and how do i build a function to make it turn on and off with the press of a button. like if i hit f2 it starts and if i hit f2 again in stops plz help me. have been to 4 different site reading tutorials and i have gotten pretty good at C++ But I Am Truly Stuck
You haven't found what you're looking for because you're confusing two different things with the same name.

You're talking about a macro as in "a series of simulated user input events that can be executed many times".

In C/++, a macro is a string of characters that the preprocessor is told to replace by a different string of characters. Example: #define int long This will change all appearances of "int" to "long".

What you want to do can be done in C++, but how you do it will depend on your system.
closed account (105oizwU)
Ok.... wtf are you talking about, ok i am looking to make a program that repeditly presses a key every few seconds, and you can turn in on and off by pressing f2

i mean when i press f2 it starts clicking the space bar every 2 seconds, when you press f2 again it stops pressing space bar
Last edited on
Hm. I guess I misunderstood you when you said
[The macro] Needs To Be Able To Press A Key every 2 seconds.
You could have been a bit more polite about it, though.

Like I said,
What you want to do can be done [...], but how you do it will depend on your system.
Topic archived. No new replies allowed.