Codota Logo
com.jme3.input
Code IndexAdd Codota to your IDE (free)

How to use com.jme3.input

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

  • Add the Codota plugin to your IDE and get smart completions
private void myMethod () {
Point p =
  • Codota Iconnew Point(x, y)
  • Codota Iconnew Point()
  • Codota IconMouseEvent e;e.getPoint()
  • Smart code suggestions by Codota
}
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

/**
 * The joystick index.
 * 
 * @return joystick index.
 * 
 * @see com.jme3.input.InputManager#getJoysticks() 
 */
public int getJoyIndex() {
  return button.getJoystick().getJoyId();
}
origin: jMonkeyEngine/jmonkeyengine

  @Override
  public String toString(){
    return "JoystickButton[name=" + getName() + ", parent=" + parent.getName() + ", id=" + getButtonId() 
                  + ", logicalId=" + getLogicalId() + "]";
  }
}
origin: jMonkeyEngine/jmonkeyengine

/**
 * Sets custom triggers for zooming in the cam
 * default is
 * new MouseAxisTrigger(MouseInput.AXIS_WHEEL, true)  mouse wheel up
 * @param triggers
 */
public void setZoomInTrigger(Trigger... triggers) {
  inputManager.deleteMapping(CameraInput.CHASECAM_ZOOMIN);
  inputManager.addMapping(CameraInput.CHASECAM_ZOOMIN, triggers);
  inputManager.addListener(this, CameraInput.CHASECAM_ZOOMIN);
}
origin: jMonkeyEngine/jmonkeyengine

@Override
public Object jmeClone() {
  ChaseCamera cc = new ChaseCamera(cam, inputManager);
  cc.target = target;
  cc.setMaxDistance(getMaxDistance());
  cc.setMinDistance(getMinDistance());
  return cc;
}     
origin: jMonkeyEngine/jmonkeyengine

private void setupChaseCamera() {
  flyCam.setEnabled(false);
  chaseCam = new ChaseCamera(cam, model, inputManager);
}
origin: jMonkeyEngine/jmonkeyengine

/**
 * Gets the index number for the X axis on the joystick.
 *
 * <p>E.g. for most gamepads, the left control stick X axis will be returned.
 *
 * @return The axis index for the X axis for this joystick.
 *
 * @see Joystick#assignAxis(java.lang.String, java.lang.String, int)
 */
@Override
public int getXAxisIndex(){
  return getXAxis().getAxisId();
}
origin: jMonkeyEngine/jmonkeyengine

/**
 * Gets the index number for the Y axis on the joystick.
 *
 * <p>E.g. for most gamepads, the left control stick Y axis will be returned.
 *
 * @return The axis index for the Y axis for this joystick.
 *
 * @see Joystick#assignAxis(java.lang.String, java.lang.String, int)
 */
@Override
public int getYAxisIndex(){
  return getYAxis().getAxisId();
}
origin: jMonkeyEngine/jmonkeyengine

/**
 * The joystick index.
 * 
 * @return joystick index.
 * 
 * @see InputManager#getJoysticks() 
 */
public int getJoyIndex() {
  return axis.getJoystick().getJoyId();
}
origin: jMonkeyEngine/jmonkeyengine

/**
 * @param dragToRotate When true, the user must hold the mouse button
 * and drag over the screen to rotate the camera, and the cursor is
 * visible until dragged. Otherwise, the cursor is invisible at all times
 * and holding the mouse button is not needed to rotate the camera.
 * This feature is disabled by default.
 */
public void setDragToRotate(boolean dragToRotate) {
  this.dragToRotate = dragToRotate;
  this.canRotate = !dragToRotate;
  inputManager.setCursorVisible(dragToRotate);
}
origin: jMonkeyEngine/jmonkeyengine

  @Override
  public int getYAxisIndex() {
    return povAxisY.getAxisId();
  }
}
origin: jMonkeyEngine/jmonkeyengine

/**
 * The button index.
 * 
 * @return button index.
 * 
 * @see Joystick#assignButton(java.lang.String, int) 
 */
public int getButtonIndex() {
  return button.getButtonId();
}
origin: jMonkeyEngine/jmonkeyengine

/**
 * Sets the min zoom distance of the camera (default is 1)
 */
public void setMinDistance(float minDistance) {
  this.minDistance = minDistance;
  if (minDistance > distance) {
    zoomCamera(distance - minDistance);
  }
}
origin: jMonkeyEngine/jmonkeyengine

/**
 * update the camera control, should only be used internally
 * @param tpf
 */
public void update(float tpf) {
  updateCamera(tpf);
}
origin: jMonkeyEngine/jmonkeyengine

public void addAxis(final int index, final JoystickAxis axis) {
  super.addAxis(axis);
  if (index == 0) {
    povAxisX = axis;
  } else if (index == 1) {
    povAxisY = axis;
  }
}
origin: jMonkeyEngine/jmonkeyengine

/**
 * Rumbles the joystick for the given amount/magnitude.
 *
 * @param amount The amount to rumble. Should be between 0 and 1.
 */
@Override
public void rumble(float amount){
  joyInput.setJoyRumble(joyId, amount);
}
origin: jMonkeyEngine/jmonkeyengine

/**
 * Enable simulation of mouse events. Used for touchscreen input only.
 *
 * @param value True to enable simulation of mouse events
 */
public void setSimulateMouse(boolean value) {
  if (touch != null) {
    touch.setSimulateMouse(value);
  }
}
/**
origin: jMonkeyEngine/jmonkeyengine

/**
 * Sets custom triggers for toggling the rotation of the cam
 * default are
 * new MouseButtonTrigger(MouseInput.BUTTON_LEFT)  left mouse button
 * new MouseButtonTrigger(MouseInput.BUTTON_RIGHT)  right mouse button
 * @param triggers
 */
public void setToggleRotationTrigger(Trigger... triggers) {
  inputManager.deleteMapping(CameraInput.CHASECAM_TOGGLEROTATE);
  inputManager.addMapping(CameraInput.CHASECAM_TOGGLEROTATE, triggers);
  inputManager.addListener(this, CameraInput.CHASECAM_TOGGLEROTATE);
}
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

/**
 * Sets custom triggers for zooming out the cam
 * default is
 * new MouseAxisTrigger(MouseInput.AXIS_WHEEL, false)  mouse wheel down
 * @param triggers
 */
public void setZoomOutTrigger(Trigger... triggers) {
  inputManager.deleteMapping(CameraInput.CHASECAM_ZOOMOUT);
  inputManager.addMapping(CameraInput.CHASECAM_ZOOMOUT, triggers);
  inputManager.addListener(this, CameraInput.CHASECAM_ZOOMOUT);
}
com.jme3.input

Most used classes

  • MouseMotionEvent
    Mouse movement event. Movement events are only generated if the mouse is on-screen.
  • FlyByCamera
    A first-person camera controller. After creation, you (or FlyCamAppState) must register the controll
  • InputManager
    The InputManager is responsible for converting input events received from the Key, Mouse and Joy Inp
  • KeyInputEvent
    Keyboard key event.
  • MouseButtonEvent
    Mouse button press/release event.
  • KeyTrigger,
  • JoyAxisEvent,
  • JoyButtonEvent,
  • JoystickAxis,
  • DummyKeyInput,
  • DummyMouseInput,
  • MouseAxisTrigger,
  • MouseButtonTrigger,
  • TouchEvent,
  • DefaultJoystickButton,
  • JoystickCompatibilityMappings,
  • AwtKeyInput,
  • AwtMouseInput,
  • InputEvent
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