Examples of KeyTrigger


Examples of com.jme3.input.controls.KeyTrigger

  }

  /** Declaring the "Shoot" action and mapping to its triggers. */
  private void initKeys() {

    inputManager.addMapping("Shoot", new KeyTrigger(KeyInput.KEY_SPACE), // trigger 1: spacebar
        new MouseButtonTrigger(MouseInput.BUTTON_LEFT)); // trigger 2: left-button click
    inputManager.addListener(actionListener, "Shoot");
  }
View Full Code Here

Examples of com.jme3.input.controls.KeyTrigger

  /**
   * We over-write some navigational key mappings here, so we can add physics-controlled walking and jumping:
   */
  private void setUpKeys() {

    inputManager.addMapping("Left", new KeyTrigger(KeyInput.KEY_A));
    inputManager.addMapping("Right", new KeyTrigger(KeyInput.KEY_D));
    inputManager.addMapping("Up", new KeyTrigger(KeyInput.KEY_W));
    inputManager.addMapping("Down", new KeyTrigger(KeyInput.KEY_S));
    inputManager.addMapping("Jump", new KeyTrigger(KeyInput.KEY_SPACE));
    inputManager.addListener(this, "Left");
    inputManager.addListener(this, "Right");
    inputManager.addListener(this, "Up");
    inputManager.addListener(this, "Down");
    inputManager.addListener(this, "Jump");
View Full Code Here

Examples of com.jme3.input.controls.KeyTrigger

  /** Custom Keybinding: Map named actions to inputs. */
  private void initKeys() {

    // You can map one or several inputs to one named action
    inputManager.addMapping("Pause", new KeyTrigger(KeyInput.KEY_P));
    inputManager.addMapping("Left", new KeyTrigger(KeyInput.KEY_J));
    inputManager.addMapping("Right", new KeyTrigger(KeyInput.KEY_K));
    inputManager.addMapping("Rotate", new KeyTrigger(KeyInput.KEY_SPACE), new MouseButtonTrigger(MouseInput.BUTTON_LEFT));
    // Add the names to the action listener.
    inputManager.addListener(actionListener, new String[] { "Pause" });
    inputManager.addListener(analogListener, new String[] { "Left", "Right", "Rotate" });

  }
View Full Code Here

Examples of com.jme3.input.controls.KeyTrigger

  }

  /** Custom Keybinding: Map named actions to inputs. */
  private void initKeys() {

    inputManager.addMapping("Walk", new KeyTrigger(KeyInput.KEY_SPACE));
    inputManager.addListener(actionListener, "Walk");
  }
View Full Code Here

Examples of com.jme3.input.controls.KeyTrigger

  private void initializeInput() {
    inputManager.clearMappings();

    // Mouse Input
    inputManager.addMapping("RotateUp", new KeyTrigger(KeyInput.KEY_Y));
    inputManager.addMapping("RotateDown", new KeyTrigger(KeyInput.KEY_X));
    inputManager.addMapping("RotateLeft", new MouseAxisTrigger(MouseInput.AXIS_X, false));
    inputManager.addMapping("RotateRight", new MouseAxisTrigger(MouseInput.AXIS_X, true));

    // Keyboard Input
    inputManager.addMapping("Accelerate", new KeyTrigger(KeyInput.KEY_W));
    inputManager.addMapping("Brake", new KeyTrigger(KeyInput.KEY_S));
    inputManager.addMapping("RollLeft", new KeyTrigger(KeyInput.KEY_Q));
    inputManager.addMapping("RollRight", new KeyTrigger(KeyInput.KEY_E));
    inputManager.addMapping("StrafeLeft", new KeyTrigger(KeyInput.KEY_A));
    inputManager.addMapping("StrafeRight", new KeyTrigger(KeyInput.KEY_D));

    inputManager.addMapping("bla", new KeyTrigger(KeyInput.KEY_LEFT));
    inputManager.addMapping("blubb", new KeyTrigger(KeyInput.KEY_RIGHT));

    inputManager.addListener(new InputListener(vehicleControl, player), new String[] { "RotateUp", "RotateDown",
        "RotateLeft", "RotateRight", "Accelerate", "Brake", "RollLeft", "RollRight", "StrafeLeft",
        "StrafeRight", "bla", "blubb" });
  }
View Full Code Here

Examples of com.jme3.input.controls.KeyTrigger

    // jInputJoyInput = new JInputJoyInput();
    // joys = jInputJoyInput.loadJoysticks(inputManager);
    // jInputJoyInput.initialize();

    inputManager.addMapping("Left", new KeyTrigger(KeyInput.KEY_LEFT));
    inputManager.addMapping("Right", new KeyTrigger(KeyInput.KEY_RIGHT));
    inputManager.addMapping("Up", new KeyTrigger(KeyInput.KEY_UP));
    inputManager.addMapping("Down", new KeyTrigger(KeyInput.KEY_DOWN));
    inputManager.addMapping("Taste", new KeyTrigger(KeyInput.KEY_Q));
    inputManager.addMapping("GibGas", new KeyTrigger(KeyInput.KEY_W));
    inputManager.addMapping("Brems", new KeyTrigger(KeyInput.KEY_S));

    // inputManager.addMapping("Accelerate", new KeyTrigger(KeyInput.KEY_W));
    // inputManager.addMapping("Brake", new KeyTrigger(KeyInput.KEY_S));

    // inputManager.addMapping("MouseXleft", new JoyAxisTrigger(0,
View Full Code Here

Examples of com.jme3.input.controls.KeyTrigger

  private void setUpKeys() {
    getContext().getKeyInput().destroy();
    getContext().getKeyInput().initialize();
    inputManager.clearMappings();
   
    inputManager.addMapping("W", new KeyTrigger(KeyInput.KEY_W));
    inputManager.addMapping("A", new KeyTrigger(KeyInput.KEY_A));
    inputManager.addMapping("S", new KeyTrigger(KeyInput.KEY_S));
    inputManager.addMapping("D", new KeyTrigger(KeyInput.KEY_D));
    inputManager.addMapping("Q", new KeyTrigger(KeyInput.KEY_Q));
    inputManager.addMapping("Y", new KeyTrigger(KeyInput.KEY_Y));
    inputManager.addMapping("Left", new KeyTrigger(KeyInput.KEY_LEFT));
    inputManager.addMapping("Right", new KeyTrigger(KeyInput.KEY_RIGHT));
    inputManager.addMapping("Up", new KeyTrigger(KeyInput.KEY_UP));
    inputManager.addMapping("Down", new KeyTrigger(KeyInput.KEY_DOWN));
    inputManager.addMapping("Shift", new KeyTrigger(KeyInput.KEY_LSHIFT));
    inputManager.addListener(LACam, new String[]{"W", "A", "S", "D", "Q", "Y", "Right", "Left", "Up", "Down", "Shift"});
   
    inputManager.addMapping("MouseXleft", new MouseAxisTrigger(MouseInput.AXIS_X, true));
    inputManager.addMapping("MouseXright", new MouseAxisTrigger(MouseInput.AXIS_X, false));
    inputManager.addMapping("MouseYup", new MouseAxisTrigger(MouseInput.AXIS_Y, true));
    inputManager.addMapping("MouseYdown", new MouseAxisTrigger(MouseInput.AXIS_Y, false));
    inputManager.addListener(LACam, new String[]{"MouseXleft", "MouseXright", "MouseYup", "MouseYdown"});
   

    inputManager.addMapping("ESC", new KeyTrigger(KeyInput.KEY_ESCAPE));
    inputManager.addListener(this, new String[]{"ESC"});

  }
View Full Code Here

Examples of com.jme3.input.controls.KeyTrigger

    sun.setDirection(new Vector3f(-0.1f, -0.7f, -1.0f));
    rootNode.addLight(sun);
  }

  private void initializeInput() {
    inputManager.addMapping("Shoot", new KeyTrigger(KeyInput.KEY_SPACE));
    inputManager.addListener(this, "Shoot");

  }
View Full Code Here

Examples of com.jme3.input.controls.KeyTrigger

  public static void main(String[] args) {
    new TestEmitter().start();
  }

  private void initializeInput() {
    inputManager.addMapping("nozzle", new KeyTrigger(KeyInput.KEY_SPACE));
    inputManager.addListener(this, "nozzle");

  }
View Full Code Here

Examples of com.jme3.input.controls.KeyTrigger

      registerPrintScreenForScreenshots();
  }
 
  public void registerPrintScreenForScreenshots()
  {
    theGame.getInputManager().addMapping("Screenshot", new KeyTrigger(KeyInput.KEY_SYSRQ));
    theGame.getInputManager().addListener(this, "Screenshot");
  }
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.