I think you can't without native code and JNI. Take a look at Java Curses library: http://sourceforge.net/projects/javacurses/
copied from :- Get key press without pressing enter in console
More reference :- In Java, what is the best way to capture a <tab> keystroke?