We're a community of 1077K IT Pros here for help, advice, solutions, professional growth and fun. Join us!
1,076,145 Members — Technology Publication meets Social Media
Username:
Password:
Lost login information?
Start New Discussion Reply to this Discussion

How to simulate mouse and keyboard input

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".

3
Contributors
2
Replies
6 Hours
Discussion Span
2 Years Ago
Last Updated
3
Views
TailsTheFox
Light Poster
26 posts since Jan 2011
Reputation Points: 10
Solved Threads: 0
Skill Endorsements: 0

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).

Ancient Dragon
Achieved Level 70
Team Colleague
32,137 posts since Aug 2005
Reputation Points: 5,836
Solved Threads: 2,576
Skill Endorsements: 69

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

pseudorandom21
Practically a Posting Shark
890 posts since Jan 2011
Reputation Points: 216
Solved Threads: 110
Skill Endorsements: 0

This article has been dead for over three months: Start a new discussion instead

Post: Markdown Syntax: Formatting Help
 
You
 
© 2013 DaniWeb® LLC
Page rendered in 0.0818 seconds using 2.84MB