void JoyAxis::setMaxZoneValue(int value) { value = abs(value); if (value >= AXISMAX) { maxZoneValue = AXISMAX; emit propertyUpdated(); } else { maxZoneValue = value; emit propertyUpdated(); } }
void SetJoystick::setName(QString name) { if (name.length() <= MAXNAMELENGTH) { this->name = name; emit propertyUpdated(); } else if (name.length() > MAXNAMELENGTH) { // Truncate name to 27 characters. Add ellipsis at the end. name.truncate(MAXNAMELENGTH-3); this->name = QString(name).append("..."); emit propertyUpdated(); } }
void JoyAxis::setControlStick(JoyControlStick *stick) { removeVDPads(); removeControlStick(); this->stick = stick; emit propertyUpdated(); }
void JoyControlStickButton::setChangeSetCondition(SetChangeCondition condition, bool passive) { SetChangeCondition oldCondition = setSelectionCondition; if (condition != setSelectionCondition && !passive) { if (condition == SetChangeWhileHeld || condition == SetChangeTwoWay) { // Set new condition emit setAssignmentChanged(index, this->stick->getIndex(), setSelection, condition); } else if (setSelectionCondition == SetChangeWhileHeld || setSelectionCondition == SetChangeTwoWay) { // Remove old condition emit setAssignmentChanged(index, this->stick->getIndex(), setSelection, SetChangeDisabled); } setSelectionCondition = condition; } else if (passive) { setSelectionCondition = condition; } if (setSelectionCondition == SetChangeDisabled) { setChangeSetSelection(-1); } if (setSelectionCondition != oldCondition) { buildActiveZoneSummaryString(); emit propertyUpdated(); } }
void JoyAxis::setAxisName(QString tempName) { if (tempName.length() <= 20 && tempName != axisName) { axisName = tempName; emit axisNameChanged(); emit propertyUpdated(); } }
void JoyAxis::removeControlStick(bool performRelease) { if (stick) { if (performRelease) { stick->releaseButtonEvents(); } this->stick = 0; emit propertyUpdated(); } }
/** * @brief Set throttle value for axis. * @param Current value for axis. */ void JoyAxis::setThrottle(int value) { if (value >= JoyAxis::NegativeHalfThrottle && value <= JoyAxis::PositiveHalfThrottle) { if (value != throttle) { throttle = value; adjustRange(); emit throttleChanged(); emit propertyUpdated(); } } }
void JoyAxis::disconnectPropertyUpdatedConnection() { disconnect(this, SIGNAL(propertyUpdated()), getParentSet()->getInputDevice(), SLOT(profileEdited())); }
void JoyAxis::setDeadZone(int value) { deadZone = abs(value); emit propertyUpdated(); }
void SetJoystick::disconnectPropertyUpdatedConnection() { disconnect(this, SIGNAL(propertyUpdated()), getInputDevice(), SLOT(profileEdited())); }