2

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!

R. Martinho Fernandes
  • 228,013
  • 71
  • 433
  • 510
Zakum
  • 491
  • 1
  • 5
  • 6

1 Answers1

6

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.

Community
  • 1
  • 1
Stardidi
  • 308
  • 2
  • 10