wood burning stoves*
The moose likes Java in General and the fly likes Ghosting keyboard input Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Java » Java in General
Bookmark "Ghosting keyboard input" Watch "Ghosting keyboard input" New topic
Author

Ghosting keyboard input

kyle amburn
Ranch Hand

Joined: Jul 29, 2001
Posts: 64
Hi All-
I was wondering if anyone knows a way to "ghost" keyboard input in java. Here is my problem: I want to have a program that is not the active program in a Windows environment be able to get a copy of the keyboard input that is intended for another program. If the input matches certain critera than it is to be recorded in this "ghost" program.
The KeyListener interface requires the component it is connected to to be an active componenet. Is there a way to do this?
Thanks,
Kyle
Paul Keohan
Ranch Hand

Joined: Mar 15, 2000
Posts: 411
Do you have access to the code that attaches the KeyListener to the active window? Because then all you should need to do is add code to your keyPressed() method and do what you need to do.
kyle amburn
Ranch Hand

Joined: Jul 29, 2001
Posts: 64
Hi Paul-
The active window is actually an AS/400 program. I do not have access to this programs code. I know that this can be done using Windows programming, but my other application is written in Java and I would perfer not to try and do it with native calls to still another program written in VB or C.
Thanks,
Kyle
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: Ghosting keyboard input