MCPcopy Create free account
hub / github.com/AntiMicroX/antimicrox / isRelativeSpring

Method isRelativeSpring

src/joycontrolstick.cpp:2671–2697  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2669}
2670
2671bool JoyControlStick::isRelativeSpring()
2672{
2673 bool relative = false;
2674
2675 QHash<JoyStickDirections, JoyControlStickButton *> temphash = getApplicableButtons();
2676 auto iter = temphash.cbegin();
2677
2678 if (iter == temphash.cend())
2679 return relative;
2680
2681 JoyControlStickButton *button = iter.value();
2682 relative = button->isRelativeSpring();
2683
2684 while (++iter != temphash.cend())
2685 {
2686 button = iter.value();
2687 bool temp = button->isRelativeSpring();
2688
2689 if (temp != relative)
2690 {
2691 relative = false;
2692 break;
2693 }
2694 }
2695
2696 return relative;
2697}
2698
2699/**
2700 * @brief Copy slots from all stick buttons and properties from a stick

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected