/** * 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)); } }
public int triggerHashCode() { return joyAxisHash(joyId, axisId, negative); }
float effectiveDeadZone = Math.max(globalAxisDeadZone, evt.getAxis().getDeadZone()); if (value < effectiveDeadZone && value > -effectiveDeadZone) { int hash1 = JoyAxisTrigger.joyAxisHash(joyId, axis, true); int hash2 = JoyAxisTrigger.joyAxisHash(joyId, axis, false); int hash = JoyAxisTrigger.joyAxisHash(joyId, axis, true); int otherHash = JoyAxisTrigger.joyAxisHash(joyId, axis, false); axisValues.remove(otherHash); } else { int hash = JoyAxisTrigger.joyAxisHash(joyId, axis, false); int otherHash = JoyAxisTrigger.joyAxisHash(joyId, axis, true);
/** * 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 * @param axisId The axis index. * * @see Joystick#getAxisCount() * @deprecated Use JoystickAxis.assignAxis() instead. */ @Override public void assignAxis(String positiveMapping, String negativeMapping, int axisId){ // For backwards compatibility if( axisId == JoyInput.AXIS_POV_X ) { axisId = getPovXAxis().getAxisId(); } else if( axisId == JoyInput.AXIS_POV_Y ) { axisId = getPovYAxis().getAxisId(); } inputManager.addMapping(positiveMapping, new JoyAxisTrigger(joyId, axisId, false)); inputManager.addMapping(negativeMapping, new JoyAxisTrigger(joyId, axisId, true)); }
public int triggerHashCode() { return joyAxisHash(joyId, axisId, negative); }
/** * 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 * @param axisId The axis index. * * @see Joystick#getAxisCount() */ public void assignAxis(String positiveMapping, String negativeMapping, int axisId){ inputManager.addMapping(positiveMapping, new JoyAxisTrigger(joyId, axisId, false)); inputManager.addMapping(negativeMapping, new JoyAxisTrigger(joyId, axisId, true)); }
public int triggerHashCode() { return joyAxisHash(joyId, axisId, negative); }
/** * 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)); } }
float value = evt.getValue(); if (value < axisDeadZone && value > -axisDeadZone) { int hash1 = JoyAxisTrigger.joyAxisHash(joyId, axis, true); int hash2 = JoyAxisTrigger.joyAxisHash(joyId, axis, false); int hash = JoyAxisTrigger.joyAxisHash(joyId, axis, true); int otherHash = JoyAxisTrigger.joyAxisHash(joyId, axis, false); invokeAnalogsAndActions(hash, -value, true); axisValues.put(hash, -value); axisValues.remove(otherHash); } else { int hash = JoyAxisTrigger.joyAxisHash(joyId, axis, false); int otherHash = JoyAxisTrigger.joyAxisHash(joyId, axis, true); invokeAnalogsAndActions(hash, value, true); axisValues.put(hash, value);
/** * 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 * @param axisId The axis index. * * @see Joystick#getAxisCount() * @deprecated Use JoystickAxis.assignAxis() instead. */ @Override public void assignAxis(String positiveMapping, String negativeMapping, int axisId){ // For backwards compatibility if( axisId == JoyInput.AXIS_POV_X ) { axisId = getPovXAxis().getAxisId(); } else if( axisId == JoyInput.AXIS_POV_Y ) { axisId = getPovYAxis().getAxisId(); } inputManager.addMapping(positiveMapping, new JoyAxisTrigger(joyId, axisId, false)); inputManager.addMapping(negativeMapping, new JoyAxisTrigger(joyId, axisId, true)); }
float effectiveDeadZone = Math.max(globalAxisDeadZone, evt.getAxis().getDeadZone()); if (value < effectiveDeadZone && value > -effectiveDeadZone) { int hash1 = JoyAxisTrigger.joyAxisHash(joyId, axis, true); int hash2 = JoyAxisTrigger.joyAxisHash(joyId, axis, false); int hash = JoyAxisTrigger.joyAxisHash(joyId, axis, true); int otherHash = JoyAxisTrigger.joyAxisHash(joyId, axis, false); axisValues.remove(otherHash); } else { int hash = JoyAxisTrigger.joyAxisHash(joyId, axis, false); int otherHash = JoyAxisTrigger.joyAxisHash(joyId, axis, true);