Java Code Examples for com.jme3.input.event.KeyInputEvent#isReleased()

The following examples show how to use com.jme3.input.event.KeyInputEvent#isReleased() . You can vote up the ones you like or vote down the ones you don't like, and go to the original project or source file by following the links above each example. You may check out the related API usage on the sidebar.
Example 1
Source File: TestBitmapFont.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public void onKeyEvent(KeyInputEvent evt) {
    if (evt.isReleased())
        return;
    if (evt.getKeyChar() == '\n' || evt.getKeyChar() == '\r') {
        txt3.setText(str.toString());
        str.setLength(0);
    } else {
        str.append(evt.getKeyChar());
    }
}
 
Example 2
Source File: ComposerCameraController.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public void onKeyEvent(KeyInputEvent kie) {
    //don't forget the super call
    super.onKeyEvent(kie);
    if (kie.isPressed()) {
        if (KeyInput.KEY_LSHIFT == kie.getKeyCode()) {
            forceCameraControls = true;
        }
    } else if (kie.isReleased()) {
        if (KeyInput.KEY_LSHIFT == kie.getKeyCode()) {
            forceCameraControls = false;
        }
    }
}
 
Example 3
Source File: TerrainCameraController.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
@Override
public void onKeyEvent(KeyInputEvent kie) {
    super.onKeyEvent(kie);
    if (kie.isPressed()) {
        if (KeyInput.KEY_LSHIFT == kie.getKeyCode()) {
            forceCameraControls = true;
        }
    } else if (kie.isReleased()) {
        if (KeyInput.KEY_LSHIFT == kie.getKeyCode()) {
            forceCameraControls = false;
        }
    }
}
 
Example 4
Source File: AbstractCameraController.java    From MikuMikuStudio with BSD 2-Clause "Simplified" License 5 votes vote down vote up
public void onKeyEvent(KeyInputEvent kie) {
    if (kie.isPressed()) {
        if (KeyInput.KEY_LSHIFT == kie.getKeyCode()) {
            shiftModifier = true;
        }
    } else if (kie.isReleased()) {
        if (KeyInput.KEY_LSHIFT == kie.getKeyCode()) {
            shiftModifier = false;
        }
    }
}