reading a skingle key without pressing ENTER after  
Author Message
Michael Borgwardt





PostPosted: 2003-12-4 1:57:00 Top

java-programmer, reading a skingle key without pressing ENTER after Denis wrote:
> Maybe I could write my own read() function
> deal with all backspace pressed etc...
>
> How do I read then a single key in Java?
> So it'll get just one keystroke and return key value
> without presing ENTER ?

You can't - that's the source of the problem and where
all attempts at a solution will fail.

 
Tor Iver Wilhelmsen





PostPosted: 2003-12-4 3:12:00 Top

java-programmer >> reading a skingle key without pressing ENTER after "Denis" <email***@***.com> writes:

> How do I read then a single key in Java?

Change System.in to a non-buffered stream connected to a TTY and put
that TTY into cbreak mode.
 
Denis





PostPosted: 2003-12-4 4:34:00 Top

java-programmer >> reading a skingle key without pressing ENTER after Maybe I could write my own read() function
deal with all backspace pressed etc...

How do I read then a single key in Java?
So it'll get just one keystroke and return key value
without presing ENTER ?

Thanks so much !
Den