DIGIT-ARC read-only archive · snapshot: July 23, 2026

How to generate keystrokes for use by any program?

3 posts · originally from https://geek.digit.in/community/threads/how-to-generate-keystrokes-for-use-by-any-program.153502/

H
hotshot05 Original post #1
Mar 3, 2012 at 12:47 AM
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
RCuber #2
Mar 3, 2012 at 3:12 AM
AutoHotkey.
A
Mar 3, 2012 at 9:26 PM
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.