|
Here's the problem you face; you can grab the input stream through System.in, but putting together the input can be tricky, as I'm not sure what bytes correspond to "left" and "right". If I were you, I'd put the whole program in a while loop and wrap System.in with BufferedInputStream. Every iteration, check to see if left or right has been pressed and do stuff accordingly.
I haven't tried this, but it's where I would start if I were doing the same project as you are.
|