Example usage for java.awt.event InputEvent getModifiers

List of usage examples for java.awt.event InputEvent getModifiers

Introduction

In this page you can find the example usage for java.awt.event InputEvent getModifiers.

Prototype

@Deprecated(since = "9")
public int getModifiers() 

Source Link

Document

Returns the modifier mask for this event.

Usage

From source file:Main.java

/**
 * Returns whether CTRL modifier is triggered by the specified event or not.
 *
 * @param event event to process/*  w ww. j  av  a 2s  . c  o m*/
 * @return true if CTRL modifier is triggered by the specified event, false otherwise
 */
public static boolean isCtrl(final InputEvent event) {
    return isCtrl(event.getModifiers());
}

From source file:Main.java

/**
 * Returns whether specified event contains shortcut modifier or not.
 *
 * @param event event to process//from  w w  w.  java  2  s  . c  om
 * @return true if specified event contains shortcut modifier, false otherwise
 */
public static boolean isShortcut(final InputEvent event) {
    return (event.getModifiers() & getSystemShortcutModifier()) != 0;
}

From source file:Main.java

/**
 * Returns whether ALT modifier is triggered by the specified event or not.
 *
 * @param event/*from  w  w w .ja v a  2 s . c o m*/
 *            event to process
 * @return true if ALT modifier is triggered by the specified event, false
 *         otherwise
 */
public static boolean isAlt(final InputEvent event) {
    return isAlt(event.getModifiers());
}

From source file:Main.java

/**
 * Returns whether SHIFT modifier is triggered by the specified event or
 * not./*w w w  .  ja v a2s .  c  om*/
 *
 * @param event
 *            event to process
 * @return true if SHIFT modifier is triggered by the specified event, false
 *         otherwise
 */
public static boolean isShift(final InputEvent event) {
    return isShift(event.getModifiers());
}

From source file:ucar.unidata.idv.flythrough.Flythrough.java

/**
 * _more_/*from   w  w w  . j a v a  2s  .c o m*/
 *
 * @param event _more_
 *
 * @throws RemoteException _more_
 * @throws VisADException _more_
 */
public void displayChanged(DisplayEvent event) throws VisADException, RemoteException {
    if (!isActive()) {
        return;
    }

    double[] viewpoint = viewManager.getDisplayMatrix();
    if (!Misc.arraysEquals(viewpoint, lastViewpoint)) {
        lastViewpoint = viewpoint;
        updateDashboard();
    }

    if (goToClick && (event.getId() == DisplayEvent.MOUSE_PRESSED)) {
        InputEvent inputEvent = event.getInputEvent();
        int mods = inputEvent.getModifiers();
        if ((mods & InputEvent.BUTTON1_MASK) != 0 && !inputEvent.isShiftDown() && !inputEvent.isControlDown()) {
            NavigatedDisplay navDisplay = viewManager.getNavigatedDisplay();
            location = navDisplay.screenToEarthLocation(event.getX(), event.getY());
            doDrive(false, heading);
        }
    }
}

From source file:com.mirth.connect.client.ui.Frame.java

public synchronized void updateAcceleratorKeyPressed(InputEvent e) {
    this.acceleratorKeyPressed = (((e.getModifiers()
            & Toolkit.getDefaultToolkit().getMenuShortcutKeyMask()) > 0)
            || ((e.getModifiers() & InputEvent.CTRL_MASK) > 0)
            || ((e.getModifiers() & InputEvent.ALT_MASK) > 0));
}