Win a copy of Design for the Mind this week in the Design forum!
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

Ghosting keyboard input

 
kyle amburn
Ranch Hand
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 411
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
Posts: 64
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
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
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic