Example usage for java.awt.event InputEvent isControlDown

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

Introduction

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

Prototype

public boolean isControlDown() 

Source Link

Document

Returns whether or not the Control modifier is down on this event.

Usage

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

/**
 * _more_//from   w  ww  .j a va 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);
        }
    }
}