Bug 398 : System.in skips input/no input from console possible
Last modified: 2006-09-23 20:53




Status:
RESOLVED
Resolution:
WONTFIX -
Priority:
P4
Severity:
enhancement

 

Reporter:
mschillo
Assigned To:
fry

Attachment Type Created Size Actions

Description:   Opened: 2006-09-23 13:39
Processing 0115, Mac OS X.4.7, G4

this is a perfectly reproducable phenomenon.

this code, which should pick up a line of input from the keyboard works for me in
Java:

System.out.println("Start");

String result ="";
try {
BufferedReader br = new BufferedReader(new InputStreamReader(System.in));
result = br.readLine();
System.out.println("I got: " + result);
}
catch (IOException e) {
e.printStackTrace();
}

System.out.println("End");

output is:
Start
asdfsadf
I got: asdfsadf
End

the same code in Processing produces this output:

Start
I got: null
End

And it's not even waiting for me to enter anything.

TIA,
Michael.
Additional Comment #1 From fry 2006-09-23 20:53
processing has no console support for System.in. use key and keyPressed()
to get key input.