/** * @brief Raise the dead zones for axes. Used when launching * the controller mapping window. */ void SetJoystick::raiseAxesDeadZones(int deadZone) { unsigned int tempDeadZone = deadZone; if (deadZone <= 0 || deadZone > 32767) { tempDeadZone = RAISEDDEADZONE; } QHashIterator<int, JoyAxis*> axisIter(axes); while (axisIter.hasNext()) { JoyAxis *temp = axisIter.next().value(); temp->disconnectPropertyUpdatedConnection(); temp->setDeadZone(tempDeadZone); temp->establishPropertyUpdatedConnection(); } /*QHashIterator<int, JoyControlStick*> stickIter(sticks); while (stickIter.hasNext()) { JoyControlStick *temp = stickIter.next().value(); temp->disconnectPropertyUpdatedConnection(); temp->setDeadZone(20000); temp->establishPropertyUpdatedConnection(); } */ }
void SetJoystick::setAxesDeadZones(QList<int> *axesDeadZones) { QListIterator<int> iter(*axesDeadZones); int axisNum = 0; while (iter.hasNext()) { int deadZoneValue = iter.next(); if (axes.contains(axisNum)) { JoyAxis *temp = getJoyAxis(axisNum); temp->disconnectPropertyUpdatedConnection(); temp->setDeadZone(deadZoneValue); temp->establishPropertyUpdatedConnection(); } axisNum++; } }