Tabnine Logo
KeyInput
Code IndexAdd Tabnine 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)

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

  • Finding current android device location
  • scheduleAtFixedRate (ScheduledExecutorService)
  • requestLocationUpdates (LocationManager)
  • compareTo (BigDecimal)
  • BufferedWriter (java.io)
    Wraps an existing Writer and buffers the output. Expensive interaction with the underlying reader is
  • FileNotFoundException (java.io)
    Thrown when a file specified by a program cannot be found.
  • BigInteger (java.math)
    An immutable arbitrary-precision signed integer.FAST CRYPTOGRAPHY This implementation is efficient f
  • Charset (java.nio.charset)
    A charset is a named mapping between Unicode characters and byte sequences. Every Charset can decode
  • HttpServlet (javax.servlet.http)
    Provides an abstract class to be subclassed to create an HTTP servlet suitable for a Web site. A sub
  • Table (org.hibernate.mapping)
    A relational table
  • Github Copilot alternatives
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now