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

The following are Jave code examples for showing how to use getModifiersEx() 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: incubator-netbeans   File: HyperlinkOperation.java   View Source Code Vote up 5 votes
private HyperlinkType getHyperlinkType(InputEvent e) {
    int modifiers = e.getModifiers() | e.getModifiersEx();
    if ((modifiers & altActionKeyMask) == altActionKeyMask && ((modifiers & InputEvent.SHIFT_MASK) == 0)) { // Ctrl/Cmd + Shift + Click is Add-Caret
        return HyperlinkType.ALT_HYPERLINK;
    } else if ((modifiers & actionKeyMask) == actionKeyMask && ((modifiers & InputEvent.SHIFT_MASK) == 0)) { // Ctrl/Cmd + Shift + Click is Add-Caret)
        return HyperlinkType.GO_TO_DECLARATION;
    }
    return null;
}