예제 #1
0
void JoyAxis::setMaxZoneValue(int value)
{
    value = abs(value);
    if (value >= AXISMAX)
    {
        maxZoneValue = AXISMAX;
        emit propertyUpdated();
    }
    else
    {
        maxZoneValue = value;
        emit propertyUpdated();
    }
}
예제 #2
0
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();
    }
}
예제 #3
0
void JoyAxis::setControlStick(JoyControlStick *stick)
{
    removeVDPads();
    removeControlStick();
    this->stick = stick;
    emit propertyUpdated();
}
예제 #4
0
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();
    }
}
예제 #5
0
void JoyAxis::setAxisName(QString tempName)
{
    if (tempName.length() <= 20 && tempName != axisName)
    {
        axisName = tempName;
        emit axisNameChanged();
        emit propertyUpdated();
    }
}
예제 #6
0
void JoyAxis::removeControlStick(bool performRelease)
{
    if (stick)
    {
        if (performRelease)
        {
            stick->releaseButtonEvents();
        }

        this->stick = 0;
        emit propertyUpdated();
    }
}
예제 #7
0
/**
 * @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();
        }
    }
}
예제 #8
0
void JoyAxis::disconnectPropertyUpdatedConnection()
{
    disconnect(this, SIGNAL(propertyUpdated()), getParentSet()->getInputDevice(), SLOT(profileEdited()));
}
예제 #9
0
void JoyAxis::setDeadZone(int value)
{
    deadZone = abs(value);
    emit propertyUpdated();
}
예제 #10
0
void SetJoystick::disconnectPropertyUpdatedConnection()
{
    disconnect(this, SIGNAL(propertyUpdated()), getInputDevice(), SLOT(profileEdited()));
}