Simulating the keyboard and mouse?

Started by
4 comments, last by eq 18 years, 11 months ago
I am programming in C++ DirectX 8.0 and I was woundering if there is a way to simulate keys and mouse movement and mouse clicking. I am wanting to be able to control my second computer without getting up and going over to the other computer. I know KEYDOWN shows that a key is down, but is there a way to tell the key to be pressed. I couldn't find much about this in msdn, but I wasn't sure what to look for. Thanks for any help.
Advertisement
i believe you will need to do more than send keydown message to the other computer.

first, you will need to write a simple network code(UDP will be the trick) to be able to send something over, then a program to receive on the other end. and finally the program will send the various keydown messages or mouse event to "second" computer

hope that this help
It's easy to earn respect... just work-hard and smart AND stop playing Wow in office
I have already made the host and client, I just need to know how to simulate a keydown message, mouse click, and mouse position. Maybe I shouldn't have used the word just...
Have you tried running mstsc? Probably specific to XP Pro, but whatever.
Chess is played by three people. Two people play the game; the third provides moral support for the pawns. The object of the game is to kill your opponent by flinging captured pieces at his head. Since the only piece that can be killed is a pawn, the two armies agree to meet in a pawn-infested area (or even a pawn shop) and kill as many pawns as possible in the crossfire. If the game goes on for an hour, one player may legally attempt to gouge out the other player's eyes with his King.
Also, I don't want to use someone eleses program. Hints I would like to know how to simulate keyboard, mouse, and mouse position commands. Thanks for the info though.
Under windows look up the functions keybd_event and mouse_event

Edit: Oops just saw that they suspended them under Win2000/WinNT/WinXP, use SendInput instead.

This topic is closed to new replies.

Advertisement