Hello, I am looking to simulate keyboard inpout for a computer in general, not just for a window. I was allready told how to simulate keyboard strokes in a certan window, although I just want to simulate them as they might be in general. As in program says "X" and whatever place the text cursor happens to be prints "X".

Recommended Answers

All 2 Replies

There is no "general" way to do it because it is operating system specific. C and C++ do not themselves have direct support for keyboards and mice.

You could use ncurses which has been ported to both MS-DOS and *nix (there is not MS-Windows gui version of it).

If you're using Windows you will probably want to use "SendInput" in the Windows API

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.