Wrox Programmer Forums
Go Back   Wrox Programmer Forums > C# and C > C++ and Visual C++ > C++ Programming
|
C++ Programming General discussions for the C++ language. For questions specific to Microsoft's Visual C++ variant, see the Visual C++ forum instead.
Welcome to the p2p.wrox.com Forums.

You are currently viewing the C++ Programming section of the Wrox Programmer to Programmer discussions. This is a community of software programmers and website developers including Wrox book authors and readers. New member registration was closed in 2019. New posts were shut off and the site was archived into this static format as of October 1, 2020. If you require technical support for a Wrox book please contact http://hub.wiley.com
  #1 (permalink)  
Old April 12th, 2007, 06:58 PM
Registered User
 
Join Date: Feb 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Bourne
Default Simulating a key press with c++

Hi, I am looking to write a simple C program that can simulate a button on the keyboard being pressed.
Something simple, like when you execute the program, it simulates the "Z" key being pressed once, waits 4 seconds, simulates another key press, waits another 4 seconds, etc.

If anyone knows how to do this, I would greatly appriciate it.


Reply With Quote
  #2 (permalink)  
Old April 13th, 2007, 11:49 AM
Authorized User
 
Join Date: Mar 2007
Posts: 24
Thanks: 0
Thanked 0 Times in 0 Posts
Default

in windows you can get good advice here: http://www.codeproject.com/cpp/sendkeys_cpp_Article.asp
enjoy!

Reply With Quote
  #3 (permalink)  
Old April 13th, 2007, 02:03 PM
Registered User
 
Join Date: Feb 2007
Posts: 7
Thanks: 0
Thanked 0 Times in 0 Posts
Send a message via AIM to Bourne
Default

Thank you I will use that.
:)

Reply With Quote





Similar Threads
Thread Thread Starter Forum Replies Last Post
Press Print Screen Key Using JavaScript sundar53 .NET Framework 2.0 0 November 4th, 2007 08:48 AM
Key press problem diegoblin Beginning VB 6 3 October 5th, 2006 02:10 PM
TAB KEY working together KEY PRESS event thomaz C# 4 August 20th, 2006 02:47 PM
key press event in webforms agnihotrived ADO.NET 4 March 19th, 2005 03:22 PM
Force a Key Press? ashley_y VB How-To 2 January 9th, 2004 03:59 PM





Powered by vBulletin®
Copyright ©2000 - 2020, Jelsoft Enterprises Ltd.
Copyright (c) 2020 John Wiley & Sons, Inc.