Java Code Examples for com.jme3.input.event.KeyInputEvent#isPressed()
The following examples show how to use
com.jme3.input.event.KeyInputEvent#isPressed() .
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: InputSystemJme.java From MikuMikuStudio with BSD 2-Clause "Simplified" License | 6 votes |
private void onKeyEventQueued(KeyInputEvent evt, NiftyInputConsumer nic) { int code = evt.getKeyCode(); if (code == KeyInput.KEY_LSHIFT || code == KeyInput.KEY_RSHIFT) { shiftDown = evt.isPressed(); } else if (code == KeyInput.KEY_LCONTROL || code == KeyInput.KEY_RCONTROL) { ctrlDown = evt.isPressed(); } KeyboardInputEvent keyEvt = new KeyboardInputEvent(code, evt.getKeyChar(), evt.isPressed(), shiftDown, ctrlDown); if (nic.processKeyboardEvent(keyEvt)){ evt.setConsumed(); } }
Example 2
Source File: ComposerCameraController.java From MikuMikuStudio with BSD 2-Clause "Simplified" License | 5 votes |
@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 |
@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 |
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; } } }
Example 5
Source File: ModifiedKeyInputEvent.java From Lemur with BSD 3-Clause "New" or "Revised" License | 4 votes |
public ModifiedKeyInputEvent( KeyInputEvent delegate, int modifiers ) { super(delegate.getKeyCode(), delegate.getKeyChar(), delegate.isPressed(), delegate.isRepeating()); this.delegate = delegate; this.modifiers = modifiers; }