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

QString ProfileManagement::transformButtonToConfig ( PenButton  mode,
const QString &  buttonParam 
)

Transforms the pen button function as read from the GUI into a way the xsetwacom params understand

Parameters:
mode Enumeration function mode
buttonParam Value of the button mode
Returns:
xsetwacom compatible representation of the button config

Definition at line 295 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.

{
    QString configString;
    switch (mode) {
    case Pen_Disable:
        configString.clear();
        break;
    case Pen_Button:
        configString = buttonParam;
        break;
    case Pen_LeftClick:
        configString = QString("Button 1");
        break;
    case Pen_MiddleClick:
        configString = QString("Button 2");
        break;
    case Pen_RightClick:
        configString = QString("Button 3");
        break;
    case Pen_DoubleClick:
        configString = QString("dblclick 1");
        break;
    case Pen_Keystroke:
        configString = QString("core key %1").arg(buttonParam);
        configString = configString.toLower();
        break;
    case Pen_QuoteDbl:
        configString = QString("core key quotedbl %1 quotedbl").arg(buttonParam);
        break;
    case Pen_ModeToggle:
        configString = QString("modetoggle");
        break;
    case Pen_ScreenToggle:
        configString = QString("screentoggle");
        break;
    case Pen_DisplayToggle:
        configString = QString("displaytoggle");
        break;
    }

    return configString;
}


Generated by  Doxygen 1.6.0   Back to index