I'm currently using JLine (http://jline.sourceforge.net/) to read characters from the console in Java one at a time.
Terminal terminal = TerminalFactory.getFlavor(TerminalFactory.Flavor.WINDOWS);
terminal.init();
terminal.setEchoEnabled(false);
int i;
InputStream in = terminal.wrapInIfNeeded(System.in);
i = in.read();
How can I detect if the Ctrl or Alt keys are pressed when I called in.read();
? I can't figure out from either the javadocs or any other source how to read if the Ctrl or Alt key is pressed.