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

The following are Jave code examples for showing how to use getModifiers() 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;
}
 
Example 2
Project: marathonv5   File: RComponent.java   View Source Code Vote up 4 votes
public boolean isMenuShortcutKeyDown(InputEvent event) {
    return (event.getModifiers() & Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()) != 0;
}
 
Example 3
Project: OpenJSharp   File: BasicGraphicsUtils.java   View Source Code Vote up 4 votes
static boolean isMenuShortcutKeyDown(InputEvent event) {
    return (event.getModifiers() &
            Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()) != 0;
}
 
Example 4
Project: jdk8u-jdk   File: BasicGraphicsUtils.java   View Source Code Vote up 4 votes
static boolean isMenuShortcutKeyDown(InputEvent event) {
    return (event.getModifiers() &
            Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()) != 0;
}
 
Example 5
Project: openjdk-jdk10   File: BasicGraphicsUtils.java   View Source Code Vote up 4 votes
@SuppressWarnings("deprecation")
static boolean isMenuShortcutKeyDown(InputEvent event) {
    return (event.getModifiers() &
            Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()) != 0;
}