How can I read a single character from the keyboard without having to press the 'enter' button and without using GUI classes like KeyListener?

Mark Thornton

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.

0 Comments  (click to add your comment)
Comment and Contribute






(Maximum characters: 1200). You have 1200 characters left.