Java Code Examples for java.awt.event.InputEvent.isControlDown()

The following are Jave code examples for showing how to use isControlDown() of the java.awt.event.InputEvent class. You can vote up the examples you like. Your votes will be used in our system to get more good examples.
+ Save this method
Example 1
Project: marathonv5   File: WSRecorder.java   View Source Code Vote up 6 votes
private String buildModifiersText(InputEvent e) {
    StringBuilder sb = new StringBuilder();
    if (e.isAltDown()) {
        sb.append("Alt+");
    }
    if (e.isControlDown()) {
        sb.append("Ctrl+");
    }
    if (e.isMetaDown()) {
        sb.append("Meta+");
    }
    if (e.isShiftDown()) {
        sb.append("Shift+");
    }
    if (sb.length() > 0) {
        sb.setLength(sb.length() - 1);
    }
    String mtext = sb.toString();
    return mtext;
}