OnKeyPress event -- How to do?
807603Nov 13 2007 — edited Nov 13 2007Hello, I'm trying to figure out how to make a function that knows when a certain key has been pressed (F5, perhaps) and if it has, does something.
I've pretty much found out how to do this from a GUI, but seeing as it's console based I don't know. From what I read you need to set the component to have Focus.
I don't want that, I want this to, when ever it's running, do something everytime I hit a specific key whether the window is opened or closed.
Thanks for the help that anyone can give me :D
edit: I'd just like to note this isn't for malicious use. I don't even think it's possible to write key loggers in Java.
Edited by: Maver on Nov 13, 2007 10:52 AM