Need a way to make the comupter think keys are being pressed

Again there must be some simple function that i'm looking for that i just can't seem to find, i know someone must have an idea of how to imitate key presses on a keyboard.
C++ doesn't know what a keyboard is. What operating system are you using?

freopen might be what you're looking for - you can change the source of data to stdin so that it reads from a file rather than the default (which is usually a keybaord).
Last edited on
I was thinking that perhaps somewhere within the Windows API or such that there will be a way to mimic keyboard presses, or much simpler (for me) ASCII code input

Basically i need the program to imitate a user typing at a keyboard.

If it helps I am using windows 7 home basic, 64bit, however i want this app to be able to run on any windows version
I've found something under WshShell.SendKeys and i'm hoping it may work for what i need it for but it looks like it might need certain characters to be marked with curely braces... i.e. {+} and {~} or such.

This is sort of what i'm looking for so if anyone knows anything that may be a little easier to use then i'd be grateful.
Still not answered, I thought i found a solution but i cant get the VBScript to work with my C++, i've got no idea what to do.
So back to my question of is there any way todo this such as a function in the WinAPI or perhaps a simple library i could add?

Thanks guys
Sending a window message?
SendMessage(HWND,WM_KEYDOWN,KEY,EXTRA);
Last edited on
I can try it, do you know what the arguments are (or how to use them)?
Last edited on
*bump*
Topic archived. No new replies allowed.