Logo Search packages:      
Sourcecode: kcm-tablet version File versions  Download package

ProfileManagement::PenButton ProfileManagement::getPenButtonFunction ( const QString &  buttonParam  ) 

Transforms the retrieved pen button function from xsetwacom into an Enumeration

Parameters:
buttonParam name of the Button to ask for
Returns:
Button function as Enumeration

Definition at line 218 of file profilemanagement.cpp.

References Pen_Button, Pen_Disable, Pen_DisplayToggle, Pen_DoubleClick, Pen_Keystroke, Pen_LeftClick, Pen_MiddleClick, Pen_ModeToggle, Pen_QuoteDbl, Pen_RightClick, and Pen_ScreenToggle.

Referenced by Wacom::PenWidget::loadFromProfile().

{
    if (buttonParam.contains("button 1", Qt::CaseInsensitive)) {
        return Pen_LeftClick;
    }

    if (buttonParam.contains("button 3", Qt::CaseInsensitive)) {
        return Pen_RightClick;
    }

    if (buttonParam.contains("button 2", Qt::CaseInsensitive)) {
        return Pen_MiddleClick;
    }

    if (buttonParam.contains("button", Qt::CaseInsensitive)) {
        return Pen_Button;
    }

    if (buttonParam.contains("dblclick 1")) {
        return Pen_DoubleClick;
    }

    if (buttonParam.contains("quotedbl", Qt::CaseInsensitive)) {
        return Pen_QuoteDbl;
    }

    if (buttonParam.contains("modetoggle", Qt::CaseInsensitive)) {
        return Pen_ModeToggle;
    }

    if (buttonParam.contains("displaytoggle", Qt::CaseInsensitive)) {
        return Pen_DisplayToggle;
    }

    if (buttonParam.contains("screentoggle", Qt::CaseInsensitive)) {
        return Pen_ScreenToggle;
    }

    if (buttonParam.contains("core key", Qt::CaseInsensitive)) {
        return Pen_Keystroke;
    }

    return Pen_Disable;
}


Generated by  Doxygen 1.6.0   Back to index