Examples of KeyTrigger


Examples of com.jme3.input.controls.KeyTrigger

    super(id, actionName);
  }

  @Override
  public void addKeyMapping(InputManager man) {
     man.addMapping(name, new KeyTrigger(KeyInput.KEY_A));//new MouseButtonTrigger(MouseInput.BUTTON_LEFT));
       man.addListener(this, name);
  }
View Full Code Here

Examples of com.jme3.input.controls.KeyTrigger

    super(id, actionName);
  }

  @Override
  public void addKeyMapping(InputManager man) {
     man.addMapping(name, new KeyTrigger(KeyInput.KEY_M));
       man.addListener(this, name);
  }
View Full Code Here

Examples of com.jme3.input.controls.KeyTrigger

    // TODO Auto-generated constructor stub
  }

  @Override
  public void addKeyMapping(InputManager man) {
     man.addMapping("CompanionAction", new KeyTrigger(KeyInput.KEY_C));
       man.addListener(this, "CompanionAction");
  }
View Full Code Here

Examples of com.jme3.input.controls.KeyTrigger

    @Override
    public void setEnabled(boolean enabled) {
        super.setEnabled(enabled);
        if (enabled) {
            application.getInputManager().addMapping("W", new KeyTrigger(KeyInput.KEY_H));
            application.getInputManager().addMapping("N", new KeyTrigger(KeyInput.KEY_K));
            application.getInputManager().addMapping("S", new KeyTrigger(KeyInput.KEY_J));
            application.getInputManager().addMapping("E", new KeyTrigger(KeyInput.KEY_L));
            // wtf? where is this listener being deleted?
            application.getInputManager().addListener(new ActionListener() {
                @Override
                public void onAction(String name, boolean isPressed, float tpf) {
                    if (model.player != null && isPressed) {
View Full Code Here

Examples of com.jme3.input.controls.KeyTrigger

        guiViewPort.addProcessor(niftyDisplay);

        stateManager.attach(gameState);

        inputManager.setCursorVisible(true);
        inputManager.addMapping("menu", new KeyTrigger(KeyInput.KEY_F6));
        inputManager.addListener(new ActionListener() {
            @Override
            public void onAction(String name, boolean isPressed, float tpf) {
                // toggle game state
                if (isPressed)
View Full Code Here

Examples of com.jme3.input.controls.KeyTrigger

        this.app = app;
        this.inputManager = app.getInputManager();
       
        if (app.getInputManager() != null) {
            inputManager.addMapping(INPUT_MAPPING_CAMERA_POS, new KeyTrigger(KeyInput.KEY_C));
            inputManager.addMapping(INPUT_MAPPING_MEMORY, new KeyTrigger(KeyInput.KEY_M));
           
            inputManager.addListener(keyListener,
                                     INPUT_MAPPING_CAMERA_POS,
                                     INPUT_MAPPING_MEMORY);                  
        }              
View Full Code Here

Examples of com.jme3.input.controls.KeyTrigger

                flyCam.setMoveSpeed(1f); // odd to set this here but it did it before
                stateManager.getState(FlyCamAppState.class).setCamera( flyCam );
            }

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

            if (stateManager.getState(StatsAppState.class) != null) {
                inputManager.addMapping(INPUT_MAPPING_HIDE_STATS, new KeyTrigger(KeyInput.KEY_F5));
                inputManager.addListener(actionListener, INPUT_MAPPING_HIDE_STATS);           
            }
           
            inputManager.addListener(actionListener, INPUT_MAPPING_EXIT);           
        }
View Full Code Here

Examples of com.jme3.input.controls.KeyTrigger

    @Override
    public void initialize(AppStateManager stateManager, Application app) {
        if (!super.isInitialized()){
            InputManager inputManager = app.getInputManager();
            inputManager.addMapping("ScreenShot", new KeyTrigger(KeyInput.KEY_SYSRQ));
            inputManager.addListener(this, "ScreenShot");

            List<ViewPort> vps = app.getRenderManager().getPostViews();
            ViewPort last = vps.get(vps.size()-1);
            last.addProcessor(this);
View Full Code Here

Examples of com.jme3.input.controls.KeyTrigger

    scoreAppState.initialize(getStateManager(), this);
    scoreAppState.setEnabled(true);
    // stateManager.attach(scoreAppState);

    // pause unpause
    Trigger pauseTrigger = new KeyTrigger(KeyInput.KEY_SPACE);
    inputManager.addMapping("Game Pause Unpause", pauseTrigger);
    inputManager.addListener(this, new String[] { "Game Pause Unpause" });

    // init env state
    currentLevelAppState.score.initTime(timer.getTimeInSeconds());
View Full Code Here

Examples of com.jme3.input.controls.KeyTrigger

        new int[] { KeyInput.KEY_P, KeyInput.KEY_L, KeyInput.KEY_O, KeyInput.KEY_K, KeyInput.KEY_I, KeyInput.KEY_J, KeyInput.KEY_U, KeyInput.KEY_H, KeyInput.KEY_Y, KeyInput.KEY_G, KeyInput.KEY_T,
            KeyInput.KEY_F, KeyInput.KEY_R, KeyInput.KEY_D, KeyInput.KEY_E, KeyInput.KEY_S, KeyInput.KEY_W, KeyInput.KEY_A, };

    for (int i = 0; i < numJoints; i++) {
      if (i < 9) { // only up to 9 joints (18 keys) bounded
        inputManager.addMapping("Right_" + i, new KeyTrigger(keyArray[2 * i]));
        inputManager.addListener(this, ("Right_" + i));
        inputManager.addMapping("Left_" + i, new KeyTrigger(keyArray[2 * i + 1]));
        inputManager.addListener(this, ("Left_" + i));
      }
    }
  }
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.