Return Styles: Pseud0ch, Terminal, Valhalla, NES, Geocities, Blue Moon. Entire thread

Reading just one character from stdin

Name: Anonymous 2010-12-29 20:04

Learning some Java. I'm making a sort of brainfuck compiler out of boredom
http://en.wikipedia.org/wiki/Brainfuck
It's all done except the part where I have to read a byte from the standard input (works fine with bf programs that don't require input, even a cool ascii fractal generator i found).

So my question is, how can i read a single key from the keyboard? I could use a Scanner and make it read from System.in and take the first character, but the user would have to type something, which would appear on the screen, and then press enter, and that's not what I want.
I just want to read one character from the keyboard, without it appearing on the screen, and without the user having to press enter after it.

Any help?

Name: Anonymous 2010-12-30 10:33

>>10
almost. It's because nobody who posted here knows the answer, except >>7 , or they wouldn't be saying it can be answered by a simple google search. but their ego is too weak to admit it.
If I come here and ask the absolute dumbest question in the world, I get a serious reply, but if I ask something nobody knows I get replies of the manner "your question is too dumb to deserve an answer"

Newer Posts
Don't change these.
Name: Email:
Entire Thread Thread List