inputManager.addRawInputListener( new JoystickEventListener() );
public void initialize(RenderManager rm, ViewPort vp) { this.renderManager = rm; if (renderDev != null) { renderDev.setRenderManager(rm); } else { batchRendererBackend.setRenderManager(rm); } if (inputManager != null) { // inputSys.setInputManager(inputManager); inputManager.addRawInputListener(inputSys); } inited = true; this.vp = vp; this.renderer = rm.getRenderer(); inputSys.reset(); inputSys.setHeight(vp.getCamera().getHeight()); }
guiNode.attachChild(cursor); inputManager.addRawInputListener(inputListener);
@Override public void simpleInitApp() { inputManager.addMapping("WordWrap", new KeyTrigger(KeyInput.KEY_TAB)); inputManager.addListener(keyListener, "WordWrap"); inputManager.addRawInputListener(textListener); BitmapFont fnt = assetManager.loadFont("Interface/Fonts/Default.fnt"); txt = new BitmapText(fnt, false); txt.setBox(new Rectangle(0, 0, settings.getWidth(), settings.getHeight())); txt.setSize(fnt.getPreferredSize() * 2f); txt.setText(txtB); txt.setLocalTranslation(0, txt.getHeight(), 0); guiNode.attachChild(txt); txt2 = new BitmapText(fnt, false); txt2.setSize(fnt.getPreferredSize() * 1.2f); txt2.setText("Text without restriction. \nText without restriction. Text without restriction. Text without restriction"); txt2.setLocalTranslation(0, txt2.getHeight(), 0); guiNode.attachChild(txt2); txt3 = new BitmapText(fnt, false); txt3.setBox(new Rectangle(0, 0, settings.getWidth(), 0)); txt3.setText("Press Tab to toggle word-wrap. type text and enter to input text"); txt3.setLocalTranslation(0, settings.getHeight()/2, 0); guiNode.attachChild(txt3); }
public MouseAppState( Application app ) { setEnabled(true); // We do this as early as possible because we want // first crack at the mouse events. app.getInputManager().addRawInputListener(mouseObserver); }
public KeyInterceptState( Application app ) { setEnabled(true); // We do this as early as possible because we want to // make sure to be able to capture everything if we // are enabled. app.getInputManager().addRawInputListener(keyObserver); }
public TouchAppState( Application app ) { setEnabled(true); // We do this as early as possible because we want // first crack at the mouse events. app.getInputManager().addRawInputListener(touchObserver); }
public InputMapper( InputManager inputManager ) { this.inputManager = inputManager; this.listener = new InputObserver(); inputManager.addRawInputListener(listener); Joystick[] sticks = inputManager.getJoysticks(); if( sticks != null ) { for( Joystick j : sticks ) { mapJoystick(j); } } // The default group always starts active. activeGroups.add(FunctionId.DEFAULT_GROUP); lastFrameNanos = System.nanoTime(); }
@Override public void setEnabled(boolean enabled) { super.setEnabled(enabled); this.playSound(enabled); if (enabled) { LOGGER.log(Level.INFO, "Cheat mode activated. Please enter your cheat code"); this.app.getInputManager().addRawInputListener(this); } else { this.app.getInputManager().removeRawInputListener(this); if (!this.success) { LOGGER.log(Level.INFO, "Wrong cheat code. You entered {0}", this.cheat); } this.cheat = ""; } this.success = false; }
@Override public void initialize(AppStateManager stateManager, Application app) { super.initialize(stateManager, app); this.app = (Main) app; this.stateManager = stateManager; // Add the listener app.getInputManager().addRawInputListener(this); // Add the texts playerState.setWideScreen(true); playerState.setGeneralText(2901); }
@Override public void setEnabled(boolean enabled) { super.setEnabled(enabled); if (enabled && !inputListenerAdded) { app.getInputManager().addRawInputListener(inputListener); inputListenerAdded = true; } else if (!enabled && inputListenerAdded) { app.getInputManager().removeRawInputListener(inputListener); inputListenerAdded = false; } }
@Override public void setEnabled(boolean enabled) { super.setEnabled(enabled); PlayerInteractionState pis = app.getStateManager().getState(PlayerInteractionState.class); if (pis != null && pis.isInitialized()) { app.getStateManager().getState(PlayerInteractionState.class).setEnabled(!enabled); console.setVisible(enabled); } if (enabled) { app.getInputManager().addRawInputListener(inputListener); } else { app.getInputManager().removeRawInputListener(inputListener); } }
@Override public void setEnabled(boolean enabled) { super.setEnabled(enabled); inputManager.setCursorVisible(!enabled); if (enabled) { changeAction(Action.MELEE); app.getInputManager().addRawInputListener(inputListener); PossessionCameraControl pcc = new PossessionCameraControl(app.getCamera(), Direction.ENTRANCE) { @Override public void onExit() { stateManager.getState(PossessionCameraState.class).setEnabled(true); } }; target.getSpatial().addControl(pcc); } else { stateManager.getState(PossessionCameraState.class).setEnabled(false); app.getInputManager().removeRawInputListener(inputListener); PlayerCamera pc = stateManager.getState(PlayerCameraState.class).getCamera(); pc.initialize(); pc.setLookAt(target.getSpatial().getLocalTranslation()); PossessionCameraControl pcc = new PossessionCameraControl(app.getCamera(), Direction.EXIT) { @Override public void onExit() { PossessionInteractionState.this.onExit(); } }; target.getSpatial().addControl(pcc); target = null; } }
state.inputManager.addRawInputListener(state.listener); break;