# How to generate keystrokes for use by any program?



## hotshot05 (Mar 3, 2012)

I need to make an application which will run in the background but send keystrokes to the application which is presently in focus. 
e.g - When system time is 11am, it will send keystrokes to write 11AM in the application which has focus. 
*Sending keystrokes just as if those keys were pressed on a connected keyboard is the main task.*
I was looking to use Processing(Processing.org) but any language/application will do.


----------



## RCuber (Mar 3, 2012)

AutoHotkey.


----------



## abhijangda (Mar 3, 2012)

As you didn't mention your operating system, I guess you are using Windows. A year ago, I developed a small application which will send clicks on the window, which is focused. This app was developed in Visual Basic simply using a function in Windows API (I'm not sure that it was WinAPI, but it came bundled with Microsoft Visual Studio 6).I think you will also find a similar function for keystrokes. You can solve your problem using .NET.


----------

