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?
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?