How can I read a single character from the keyboard without having to press the enter button and without using GUI classes like KeyListener?
Location: http://www.jguru.com/faq/view.jsp?EID=317157 Created: Jan 31, 2001 Modified: 2001-08-18 18:54:34.835 Author: Mark Thornton (http://www.jguru.com/guru/viewbio.jsp?EID=276034) Question originally posed by Ernesto Diaz (http://www.jguru.com/guru/viewbio.jsp?EID=247557 The solution to this problem is OS dependent. On Win32 you would need to use JNI to call the SetConsoleMode function to disable the line buffering. For an example of using this method, see http://msdn.microsoft.com/library/psdk/winbase/conchar_156b.htm.
Related Questions
- How can I read a single character from the keyboard without having to press the enter button and without using GUI classes like KeyListener?
- How can I read a character without echoing it to the screen, and without waiting for the user to press the Enter key?
- Sometimes the key I press on my keyboard and the character that appears on my screen are not identical. Whats wrong?