How to differentiate between tablet buttons using QTabletEvent?



  • How do you differentiate between the pen point and the pen's side buttons on a Wacom tablet pen? In the "QTabletEvent documentation":http://qt-project.org/doc/qt-4.8/qtabletevent.html#PointerType-enum , the PointerType enum only defines QTabletEvent::UnknownPointer, QTabletEvent::Pen, QTabletEvent::Cursor, and QTabletEvent::Eraser.

    Here's some sample code:
    @
    void MyClass::tabletEvent(QTabletEvent *event)
    {
    if (event->pointerType() == QTabletEvent::Pen) {
    // do stuff if the pen tip is pressed on the tablet, this works as expected
    } else if (event->pointerType() == QTabletEvent::Eraser) {
    // do stuff if the eraser is pressed on the tablet, this works as expected
    } else if (event->pointerType() == QTabletEvent::Button0) {
    // *****I'm looking for something similar to this nonexistent event
    }
    update(); // redraw the widget
    }
    @

    And a diagram:
    !http://i.imgur.com/htb7y.png(diagram)!


Log in to reply
 

Looks like your connection to Qt Forum was lost, please wait while we try to reconnect.