/** * The joystick index. * * @return joystick index. * * @see com.jme3.input.InputManager#getJoysticks() */ public int getJoyIndex() { return button.getJoystick().getJoyId(); }
private void pickGamePad(Vector2f mouseLoc){ if (lastButton != null) { CollisionResults cresults = pick(cam, mouseLoc, gamepad); for (CollisionResult cr : cresults) { Node n = cr.getGeometry().getParent(); if (n != null && (n instanceof ButtonView)) { String b = ((ButtonView) n).getName().substring("Button:".length()); String name = lastButton.getJoystick().getName().replaceAll(" ", "\\\\ "); String id = lastButton.getLogicalId().replaceAll(" ", "\\\\ "); System.out.println(name + "." + id + "=" + b); return; } } } }
public void onJoyButtonEvent(JoyButtonEvent evt) { setViewedJoystick( evt.getButton().getJoystick() ); gamepad.setButtonValue( evt.getButton(), evt.isPressed() ); }
/** * The joystick index. * * @return joystick index. * * @see com.jme3.input.InputManager#getJoysticks() */ public int getJoyIndex() { return button.getJoystick().getJoyId(); }