Codota Logo
KeyInput
Code IndexAdd Codota to your IDE (free)

How to use
KeyInput
in
com.jme3.input

Best Java code snippets using com.jme3.input.KeyInput (Showing top 16 results out of 315)

  • Common ways to obtain KeyInput
private void myMethod () {
KeyInput k =
  • Codota Iconnew DummyKeyInput()
  • Codota IconJmeContext jmeContext;jmeContext.getKeyInput()
  • Smart code suggestions by Codota
}
origin: jMonkeyEngine/jmonkeyengine

/**
 * Initializes mouse and keyboard input. Also
 * initializes joystick input if joysticks are enabled in the
 * AppSettings.
 */
private void initInput(){
  mouseInput = context.getMouseInput();
  if (mouseInput != null)
    mouseInput.initialize();
  keyInput = context.getKeyInput();
  if (keyInput != null)
    keyInput.initialize();
  touchInput = context.getTouchInput();
  if (touchInput != null)
    touchInput.initialize();
  if (!settings.getBoolean("DisableJoysticks")){
    joyInput = context.getJoyInput();
    if (joyInput != null)
      joyInput.initialize();
  }
  inputManager = new InputManager(mouseInput, keyInput, joyInput, touchInput);
}
origin: jMonkeyEngine/jmonkeyengine

protected void destroyInput(){
  if (mouseInput != null)
    mouseInput.destroy();
  if (keyInput != null)
    keyInput.destroy();
  if (joyInput != null)
    joyInput.destroy();
  if (touchInput != null)
    touchInput.destroy();
  inputManager = null;
}
 
origin: jMonkeyEngine/jmonkeyengine

/**
 * Updates the <code>InputManager</code>.
 * This will query current input devices and send
 * appropriate events to registered listeners.
 *
 * @param tpf Time per frame value.
 */
public void update(float tpf) {
  frameTPF = tpf;
  // Activate safemode if the TPF value is so small
  // that rounding errors are inevitable
  safeMode = tpf < 0.015f;
  long currentTime = keys.getInputTimeNanos();
  frameDelta = currentTime - lastUpdateTime;
  eventsPermitted = true;
  keys.update();
  mouse.update();
  if (joystick != null) {
    joystick.update();
  }
  if (touch != null) {
    touch.update();
  }
  eventsPermitted = false;
  processQueue();
  invokeUpdateActions();
  lastLastUpdateTime = lastUpdateTime;
  lastUpdateTime = currentTime;
}
origin: jMonkeyEngine/jmonkeyengine

/**
 * Initializes the InputManager.
 *
 * <p>This should only be called internally in {@link Application}.
 *
 * @param mouse
 * @param keys
 * @param joystick
 * @param touch
 * @throws IllegalArgumentException If either mouseInput or keyInput are null.
 */
public InputManager(MouseInput mouse, KeyInput keys, JoyInput joystick, TouchInput touch) {
  if (keys == null || mouse == null) {
    throw new IllegalArgumentException("Mouse or keyboard cannot be null");
  }
  this.keys = keys;
  this.mouse = mouse;
  this.joystick = joystick;
  this.touch = touch;
  keys.setInputListener(this);
  mouse.setInputListener(this);
  if (joystick != null) {
    joystick.setInputListener(this);
    joysticks = joystick.loadJoysticks(this);
  }
  if (touch != null) {
    touch.setInputListener(this);
  }
  firstTime = keys.getInputTimeNanos();
}
origin: info.projectkyoto/mms-engine

/**
 * Initializes the InputManager.
 * 
 * <p>This should only be called internally in {@link Application}.
 *
 * @param mouseInput
 * @param keyInput
 * @param joyInput
 * @throws IllegalArgumentException If either mouseInput or keyInput are null.
 */
public InputManager(MouseInput mouse, KeyInput keys, JoyInput joystick, TouchInput touch) {
  if (keys == null || mouse == null) {
    throw new NullPointerException("Mouse or keyboard cannot be null");
  }
  this.keys = keys;
  this.mouse = mouse;
  this.joystick = joystick;
  this.touch = touch;
  keys.setInputListener(this);
  mouse.setInputListener(this);
  if (joystick != null) {
    joystick.setInputListener(this);
    joysticks = joystick.loadJoysticks(this);
  }
  if (touch != null) {
    touch.setInputListener(this);
  }
  firstTime = keys.getInputTimeNanos();
}
origin: jMonkeyEngine/jmonkeyengine

/**
 * Initializes mouse and keyboard input. Also
 * initializes joystick input if joysticks are enabled in the
 * AppSettings.
 */
private void initInput(){
  mouseInput = context.getMouseInput();
  if (mouseInput != null)
    mouseInput.initialize();
  keyInput = context.getKeyInput();
  if (keyInput != null)
    keyInput.initialize();
  touchInput = context.getTouchInput();
  if (touchInput != null)
    touchInput.initialize();
  if (!settings.getBoolean("DisableJoysticks")){
    joyInput = context.getJoyInput();
    if (joyInput != null)
      joyInput.initialize();
  }
  inputManager = new InputManager(mouseInput, keyInput, joyInput, touchInput);
}
origin: org.jmonkeyengine/jme3-core

/**
 * Updates the <code>InputManager</code>.
 * This will query current input devices and send
 * appropriate events to registered listeners.
 *
 * @param tpf Time per frame value.
 */
public void update(float tpf) {
  frameTPF = tpf;
  // Activate safemode if the TPF value is so small
  // that rounding errors are inevitable
  safeMode = tpf < 0.015f;
  long currentTime = keys.getInputTimeNanos();
  frameDelta = currentTime - lastUpdateTime;
  eventsPermitted = true;
  keys.update();
  mouse.update();
  if (joystick != null) {
    joystick.update();
  }
  if (touch != null) {
    touch.update();
  }
  eventsPermitted = false;
  processQueue();
  invokeUpdateActions();
  lastLastUpdateTime = lastUpdateTime;
  lastUpdateTime = currentTime;
}
origin: org.jmonkeyengine/jme3-core

/**
 * Initializes the InputManager.
 *
 * <p>This should only be called internally in {@link Application}.
 *
 * @param mouse
 * @param keys
 * @param joystick
 * @param touch
 * @throws IllegalArgumentException If either mouseInput or keyInput are null.
 */
public InputManager(MouseInput mouse, KeyInput keys, JoyInput joystick, TouchInput touch) {
  if (keys == null || mouse == null) {
    throw new IllegalArgumentException("Mouse or keyboard cannot be null");
  }
  this.keys = keys;
  this.mouse = mouse;
  this.joystick = joystick;
  this.touch = touch;
  keys.setInputListener(this);
  mouse.setInputListener(this);
  if (joystick != null) {
    joystick.setInputListener(this);
    joysticks = joystick.loadJoysticks(this);
  }
  if (touch != null) {
    touch.setInputListener(this);
  }
  firstTime = keys.getInputTimeNanos();
}
origin: jMonkeyEngine/jmonkeyengine

protected void destroyInput(){
  if (mouseInput != null)
    mouseInput.destroy();
  if (keyInput != null)
    keyInput.destroy();
  if (joyInput != null)
    joyInput.destroy();
  if (touchInput != null)
    touchInput.destroy();
  inputManager = null;
}
origin: jMonkeyEngine/jmonkeyengine

keyInput.initialize();
origin: info.projectkyoto/mms-engine

long currentTime = keys.getInputTimeNanos();
frameDelta = currentTime - lastUpdateTime;
keys.update();
mouse.update();
if (joystick != null) {
origin: info.projectkyoto/mms-engine

protected void destroyInput(){
  if (mouseInput != null)
    mouseInput.destroy();
  if (keyInput != null)
    keyInput.destroy();
  if (joyInput != null)
    joyInput.destroy();
  
  if (touchInput != null)
    touchInput.destroy();        
  inputManager = null;
}
origin: org.jmonkeyengine/jme3-core

/**
 * Initializes mouse and keyboard input. Also
 * initializes joystick input if joysticks are enabled in the
 * AppSettings.
 */
private void initInput(){
  mouseInput = context.getMouseInput();
  if (mouseInput != null)
    mouseInput.initialize();
  keyInput = context.getKeyInput();
  if (keyInput != null)
    keyInput.initialize();
  touchInput = context.getTouchInput();
  if (touchInput != null)
    touchInput.initialize();
  if (!settings.getBoolean("DisableJoysticks")){
    joyInput = context.getJoyInput();
    if (joyInput != null)
      joyInput.initialize();
  }
  inputManager = new InputManager(mouseInput, keyInput, joyInput, touchInput);
}
origin: org.jmonkeyengine/jme3-core

protected void destroyInput(){
  if (mouseInput != null)
    mouseInput.destroy();
  if (keyInput != null)
    keyInput.destroy();
  if (joyInput != null)
    joyInput.destroy();
  if (touchInput != null)
    touchInput.destroy();
  inputManager = null;
}
origin: info.projectkyoto/mms-engine

/**
 * Initializes mouse and keyboard input. Also
 * initializes joystick input if joysticks are enabled in the
 * AppSettings.
 */
private void initInput(){
  mouseInput = context.getMouseInput();
  if (mouseInput != null)
    mouseInput.initialize();
  keyInput = context.getKeyInput();
  if (keyInput != null)
    keyInput.initialize();
  
  touchInput = context.getTouchInput();
  if (touchInput != null)
    touchInput.initialize();
  if (!settings.getBoolean("DisableJoysticks")){
    joyInput = context.getJoyInput();
    if (joyInput != null)
      joyInput.initialize();
  }
  inputManager = new InputManager(mouseInput, keyInput, joyInput, touchInput);
}
origin: org.jmonkeyengine/jme3-jogl

keyInput.initialize();
com.jme3.inputKeyInput

Javadoc

A specific API for interfacing with the keyboard.

Most used methods

  • initialize
  • destroy
  • getInputTimeNanos
  • setInputListener
  • update

Popular in Java

  • Making http post requests using okhttp
  • getContentResolver (Context)
  • requestLocationUpdates (LocationManager)
  • putExtra (Intent)
  • Hashtable (java.util)
    Hashtable is a synchronized implementation of Map. All optional operations are supported.Neither key
  • PriorityQueue (java.util)
    An unbounded priority Queue based on a priority heap. The elements of the priority queue are ordered
  • Set (java.util)
    A collection that contains no duplicate elements. More formally, sets contain no pair of elements e1
  • TimerTask (java.util)
    A task that can be scheduled for one-time or repeated execution by a Timer.
  • TimeUnit (java.util.concurrent)
    A TimeUnit represents time durations at a given unit of granularity and provides utility methods to
  • ImageIO (javax.imageio)
Codota Logo
  • Products

    Search for Java codeSearch for JavaScript codeEnterprise
  • IDE Plugins

    IntelliJ IDEAWebStormAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogCodota Academy Plugin user guide Terms of usePrivacy policyJava Code IndexJavascript Code Index
Get Codota for your IDE now