Examples of KeyTrigger


Examples of com.jme3.input.controls.KeyTrigger

    inputManager.addListener(new MouseInputListener(inputManager), InputStrings.FREE_MOUSE);
  }

  public void initCameraControlKeyListener(CameraCtrl cameraCtrl) {
    inputManager.addMapping(InputStrings.CAMERA_1ST,
        new KeyTrigger(inputBinding.getKeyBinding(InputStrings.CAMERA_1ST)));
    inputManager.addMapping(InputStrings.CAMERA_3RD,
        new KeyTrigger(inputBinding.getKeyBinding(InputStrings.CAMERA_3RD)));

    inputManager.addListener(cameraCtrl, InputStrings.CAMERA_1ST, InputStrings.CAMERA_3RD);
  }
View Full Code Here

Examples of com.jme3.input.controls.KeyTrigger

  private void initShipControlKeyListener() {
    KeyListener keyListener = new KeyListener(pvu);

    inputManager.addMapping(InputStrings.ACCELERATE,
        new KeyTrigger(inputBinding.getKeyBinding(InputStrings.ACCELERATE)));
    inputManager.addMapping(InputStrings.DECELERATE,
        new KeyTrigger(inputBinding.getKeyBinding(InputStrings.DECELERATE)));

    inputManager.addListener(keyListener, InputStrings.ACCELERATE, InputStrings.DECELERATE);
  }
View Full Code Here

Examples of com.jme3.input.controls.KeyTrigger

        if (inputManager != null) {
            flyCam = new FlyByCamera(cam);
            flyCam.registerWithInput(inputManager);

            if (context.getType() == Type.Display) {
                inputManager.addMapping("SIMPLEAPP_Exit", new KeyTrigger(KeyInput.KEY_ESCAPE));
            }

            inputManager.addMapping("SIMPLEAPP_ResetPos", new KeyTrigger(KeyInput.KEY_R));
            inputManager.addListener(actionListener, "SIMPLEAPP_Exit", "SIMPLEAPP_ResetPos");
        }

        cameraLight.setPosition(cam.getLocation());
        rootNode.addLight(cameraLight);
View Full Code Here

Examples of com.jme3.input.controls.KeyTrigger

    currentLevel = level;
  }

  public void setupKeys() {

    inputManager.addMapping("forward", new KeyTrigger(KeyInput.KEY_I));
    inputManager.addMapping("backward", new KeyTrigger(KeyInput.KEY_K));
    inputManager.addMapping("turnleft", new KeyTrigger(KeyInput.KEY_J));
    inputManager.addMapping("turnright", new KeyTrigger(KeyInput.KEY_L));
    inputManager.addMapping("toggleGameView", new KeyTrigger(KeyInput.KEY_SPACE));
    inputManager.addListener(this, "forward", "backward", "turnleft", "turnright", "givecontrol", "toggleGameView");
  }
View Full Code Here

Examples of com.jme3.input.controls.KeyTrigger

    setupJoint();
  }

  private void setupKeys() {

    inputManager.addMapping("Left", new KeyTrigger(KeyInput.KEY_H));
    inputManager.addMapping("Right", new KeyTrigger(KeyInput.KEY_K));
    inputManager.addMapping("Swing", new KeyTrigger(KeyInput.KEY_SPACE));
    inputManager.addListener(this, "Left", "Right", "Swing");
  }
View Full Code Here

Examples of com.jme3.input.controls.KeyTrigger

        bulletAppState.getPhysicsSpace().add(scene);
        //Todo
    }
    public void addControls(){
        i = new InputControl(this.flyCam);
        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.addMapping("Shoot", new MouseButtonTrigger(MouseInput.BUTTON_LEFT));

        inputManager.addListener(i, "Left");
        inputManager.addListener(i, "Right");
        inputManager.addListener(i, "Up");
View Full Code Here

Examples of com.jme3.input.controls.KeyTrigger

    listener.setLocation(camNode.getCamera().getLocation());
    listener.setRotation(camNode.getCamera().getRotation());
  }

  private void setupKeys(InputManager input) {
    input.addMapping("left", new KeyTrigger(KeyInput.KEY_A));
    input.addMapping("right", new KeyTrigger(KeyInput.KEY_D));
    input.addMapping("forward", new KeyTrigger(KeyInput.KEY_W));
    input.addMapping("backward", new KeyTrigger(KeyInput.KEY_S));
    input.addMapping("jump", new KeyTrigger(KeyInput.KEY_SPACE));
    input.addMapping("center", new KeyTrigger(KeyInput.KEY_2));
    input.addMapping("crouch", new KeyTrigger(KeyInput.KEY_LSHIFT));
    input.addMapping("camera", new KeyTrigger(KeyInput.KEY_F));
    input.addMapping("shoot", new MouseButtonTrigger(0));
    input.addMapping("head_left", new MouseAxisTrigger(0, true));
    input.addMapping("head_right", new MouseAxisTrigger(0, false));
    input.addMapping("head_up", new MouseAxisTrigger(1, false));
    input.addMapping("head_down", new MouseAxisTrigger(1, true));
View Full Code Here

Examples of com.jme3.input.controls.KeyTrigger

    rot.fromAngles(-headAngleY * FastMath.DEG_TO_RAD, -headAngleX * FastMath.DEG_TO_RAD, 0);
    headNode.setLocalRotation(rot);
  }

  private void setupKeys(InputManager input) {
    input.addMapping("jump", new KeyTrigger(KeyInput.KEY_SPACE));
    input.addMapping("center", new KeyTrigger(KeyInput.KEY_2));
    input.addMapping("crouch", new KeyTrigger(KeyInput.KEY_LSHIFT));
    input.addMapping("explode", new KeyTrigger(KeyInput.KEY_E));
    input.addMapping("head_left", new MouseAxisTrigger(0, true));
    input.addMapping("head_right", new MouseAxisTrigger(0, false));
    input.addMapping("head_up", new MouseAxisTrigger(1, false));
    input.addMapping("head_down", new MouseAxisTrigger(1, true));
    input.setCursorVisible(false);
View Full Code Here

Examples of com.jme3.input.controls.KeyTrigger

        }

    }

    private void setupKeys() {
        inputManager.addMapping("Turn Left", new KeyTrigger(KeyInput.KEY_LEFT));
        inputManager.addMapping("Turn Right", new KeyTrigger(KeyInput.KEY_RIGHT));
        inputManager.addMapping("Forward", new KeyTrigger(KeyInput.KEY_UP));
        inputManager.addMapping("Backwards", new KeyTrigger(KeyInput.KEY_DOWN));
        //inputManager.addMapping("Sit", new KeyTrigger(KeyInput.KEY_SPACE));
        inputManager.addMapping("FirstPerson", new KeyTrigger(KeyInput.KEY_F));
        inputManager.addMapping("Run", new KeyTrigger(KeyInput.KEY_R));
        inputManager.addListener(this, "FirstPerson");
        inputManager.addListener(this, "Run");
        inputManager.addListener(this, "Turn Left");
        inputManager.addListener(this, "Turn Right");
        inputManager.addListener(this, "Forward");
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.