List of usage examples for java.awt Event controlDown
public boolean controlDown()
From source file:EventTester.java
private String key_name(Event e) { char c = (char) e.key; if (e.controlDown()) { // If CTRL flag is set, handle control chars. if (c < ' ') { c += '@'; return "^" + c; }/*from w w w. j av a 2s. co m*/ } else { // If CTRL flag is not set, then certain ASCII switch (c) { // control characters have special meaning. case '\n': return "Return"; case '\t': return "Tab"; case '\033': return "Escape"; case '\010': return "Backspace"; } } // Handle the remaining possibilities. if (c == '\177') return "Delete"; else if (c == ' ') return "Space"; else return String.valueOf(c); }