private void TriggerAxisUpdate(JoystickAxis axis) { float x = axis.GetAxisX(); // Checks if input is below dead, if not it can continue, overwise it should set axis X value to 0 if (IsBelowDead(x, axis.DeadZoneX)) { axis.X = 0; axis.XChange = false; triggerInput.OnTriggerDeadZone(axis); return; } // Setting new x value to trigger axis.X = x; // Call hold method triggerInput.OnTriggerHold(axis); // Should call hold change it when position of x changes axis.XChange = axis.Dx != 0; if (axis.XChange) { triggerInput.OnTriggerChange(axis); } }
private void SetupTriggers(string left_trigger, string right_trigger) { leftTrigger = new JoystickAxis(this, left_trigger, AxisCode.LeftTrigger, LT); rightTrigger = new JoystickAxis(this, right_trigger, AxisCode.RightTrigger, RT); }