/** * The joystick index. * * @return joystick index. * * @see com.jme3.input.InputManager#getJoysticks() */ public int getJoyIndex() { return button.getJoystick().getJoyId(); }
/** * The joystick index. * * @return joystick index. * * @see InputManager#getJoysticks() */ public int getJoyIndex() { return axis.getJoystick().getJoyId(); }
/** * Assign the mappings to receive events from the given joystick axis. * * @param positiveMapping The mapping to receive events when the axis is negative * @param negativeMapping The mapping to receive events when the axis is positive */ public void assignAxis(String positiveMapping, String negativeMapping){ if (axisIndex != -1) { inputManager.addMapping(positiveMapping, new JoyAxisTrigger(parent.getJoyId(), axisIndex, false)); inputManager.addMapping(negativeMapping, new JoyAxisTrigger(parent.getJoyId(), axisIndex, true)); } }
/** * Assign the mapping name to receive events from the given button index * on the joystick. * * @param mappingName The mapping to receive joystick button events. */ public void assignButton(String mappingName) { inputManager.addMapping(mappingName, new JoyButtonTrigger(parent.getJoyId(), buttonIndex)); }
protected void dumpJoysticks( Joystick[] joysticks, PrintWriter out ) { for( Joystick j : joysticks ) { out.println( "Joystick[" + j.getJoyId() + "]:" + j.getName() ); out.println( " buttons:" + j.getButtonCount() ); for( JoystickButton b : j.getButtons() ) { out.println( " " + b ); } out.println( " axes:" + j.getAxisCount() ); for( JoystickAxis axis : j.getAxes() ) { out.println( " " + axis ); } } }
addInfo( "Joystick:\"" + stick.getName() + "\" id:" + stick.getJoyId(), 0 );
/** * The joystick index. * * @return joystick index. * * @see InputManager#getJoysticks() */ public int getJoyIndex() { return axis.getJoystick().getJoyId(); }
/** * The joystick index. * * @return joystick index. * * @see com.jme3.input.InputManager#getJoysticks() */ public int getJoyIndex() { return button.getJoystick().getJoyId(); }
/** * Assign the mapping name to receive events from the given button index * on the joystick. * * @param mappingName The mapping to receive joystick button events. */ public void assignButton(String mappingName) { inputManager.addMapping(mappingName, new JoyButtonTrigger(parent.getJoyId(), buttonIndex)); }
/** * Assign the mappings to receive events from the given joystick axis. * * @param positiveMapping The mapping to receive events when the axis is negative * @param negativeMapping The mapping to receive events when the axis is positive */ public void assignAxis(String positiveMapping, String negativeMapping){ if (axisIndex != -1) { inputManager.addMapping(positiveMapping, new JoyAxisTrigger(parent.getJoyId(), axisIndex, false)); inputManager.addMapping(negativeMapping, new JoyAxisTrigger(parent.getJoyId(), axisIndex, true)); } }