Tuesday, December 8, 2009

Java Key Generator How Can I Detect A Key Press From The System Console In Java Before The 'enter' Key Is Pressed?

How can I detect a key press from the system console in Java before the 'enter' key is pressed? - java key generator

I am working on a Java application that will be submitted to the entry and exit to the console (System.out and System.in). I need to know the pulse of a fundamental right, if you press certain that ... not even the user presses the Enter key.

For example, say I need to identify the key 'A', and if that happens, the program will System.out.println ( "A button");

When a user attempts to write the word "novel experience" to:

press romaYOU
n

I hope that common sense. I know there is no way to do it, would be avoided, however, including the creation of an invisible component to implement a KeyListener (but from what I saw, the components can not be the key if they are visible to listen) . I also do it with pure Java, not system-specific library.

Thank you to everyone who can help you!

0 comments:

Post a Comment