1

How can I get what is being inputed in any program outside my java program.. Is there a way ? For example, I'm running my java program then I start typing in notepad, and I can see with my java program what is being typed.

Tim Cooper
  • 151,519
  • 37
  • 317
  • 271
weardstuff
  • 741
  • 5
  • 14
  • 21

3 Answers3

2

The term you should looking for is Keyboard hooks, here is example using WinApi http://www.codeproject.com/KB/DLL/keyboardhook.aspx

IProblemFactory
  • 9,201
  • 8
  • 47
  • 65
1

You cannot do this in pure Java. At some point, it will involve talking to an external application or a native library, and will be platform specific in either case.

Stephen C
  • 669,072
  • 92
  • 771
  • 1,162
0

There is a library to handle native keyboard and mouse control: http://code.google.com/p/jnativehook/

Alex Barker
  • 4,103
  • 2
  • 28
  • 47