Package com.jme.input

Examples of com.jme.input.KeyBindingManager


  /**
   * creates the keyboard object, allowing us to obtain the values of a keyboard as keys are pressed. It then sets the actions to be triggered based on if certain keys are pressed (WSAD).
   */
  private void setKeyBindings() {
    KeyBindingManager keyboard = KeyBindingManager.getKeyBindingManager();

    keyboard.set("forward", KeyInput.KEY_W);
    keyboard.set("backward", KeyInput.KEY_S);
    keyboard.set("turnRight", KeyInput.KEY_D);
    keyboard.set("turnLeft", KeyInput.KEY_A);

  }
View Full Code Here


        setKeyBindings();
        addActions();
    }

    protected void setKeyBindings() {
        KeyBindingManager keyboard = KeyBindingManager.getKeyBindingManager();
        // Orbit is made out of 2 main movement types:
        // Pan&Tilt X/Y
        keyboard.set("tiltForward", KeyInput.KEY_UP);
        keyboard.set("tiltBack", KeyInput.KEY_DOWN);
        keyboard.set("turnLeft", KeyInput.KEY_LEFT);
        keyboard.set("turnRight", KeyInput.KEY_RIGHT);

        // Zooming Z
        keyboard.set("zoomIn", KeyInput.KEY_PGUP);
        keyboard.set("zoomOut", KeyInput.KEY_PGDN);

        // Translate X/Y/Z       
        keyboard.set("translateLeft", KeyInput.KEY_A);
        keyboard.set("translateRight", KeyInput.KEY_D);
        keyboard.set("translateForward", KeyInput.KEY_W);
        keyboard.set("translateBackward", KeyInput.KEY_S);
        keyboard.set("translateUp", KeyInput.KEY_Q);
        keyboard.set("translateDown", KeyInput.KEY_Z);
    }
View Full Code Here

TOP

Related Classes of com.jme.input.KeyBindingManager

Copyright © 2018 www.massapicom. 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.