Important Notice: Our web hosting provider recently started charging us for additional visits, which was unexpected. In response, we're seeking donations. Depending on the situation, we may explore different monetization options for our Community and Expert Contributors. It's crucial to provide more returns for their expertise and offer more Expert Validated Answers or AI Validated Answers. Learn more about our hosting issue here.

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

0
Posted

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

0

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

Thanksgiving questions

*Sadly, we had to bring back ads too. Hopefully more targeted.