int axis = evt.getAxisIndex(); float value = evt.getValue(); float effectiveDeadZone = Math.max(globalAxisDeadZone, evt.getAxis().getDeadZone()); if (value < effectiveDeadZone && value > -effectiveDeadZone) { int hash1 = JoyAxisTrigger.joyAxisHash(joyId, axis, true);
int axis = evt.getAxisIndex(); float value = evt.getValue(); float effectiveDeadZone = Math.max(globalAxisDeadZone, evt.getAxis().getDeadZone()); if (value < effectiveDeadZone && value > -effectiveDeadZone) { int hash1 = JoyAxisTrigger.joyAxisHash(joyId, axis, true);
public void onJoyAxisEvent( JoyAxisEvent evt ) { if( log.isTraceEnabled() ) { log.trace("onJoyAxisEvent(axis:" + evt.getAxis() + ", val:" + evt.getValue() + ")"); } JoystickAxis a = evt.getAxis(); Joystick j = a.getJoystick(); float val = evt.getValue(); // Below a certain threshold, call the value 0 float aVal = Math.abs(val); if( aVal <= 0.01 || aVal <= Math.max(a.getDeadZone(), inputManager.getAxisDeadZone()) ) { val = 0; } Axis axis = joystickAxisMap.get(a); if( axis == null ) { log.warn("No axis mapping for:" + a ); return; } StateGroupIndex index = getIndex(axis, false); if( index == null ) return; index.updateValue(val); }