Reputation: 491
I am trying to create a macro program in C++. The program is supposed to press the H key once in every 10 seconds. I have got the timing functions already, but how do I make it hit a key? So while the program runs, if I go to Notepad and leave it there, it would type "hhhhhhhh(...)"
Thanks!
Upvotes: 2
Views: 4751
Reputation: 306
A quick search turns up this question has been answered before: How to simulate a key press in C++
Their accepted answer was to use SendInput()
It completely depends on your idea in mind, but i personnaly find that if i want to make some kind of macro program AutoIt is THE way to go.
Upvotes: 6