Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • Users
  • Groups
  • Search
  • Get Qt Extensions
  • Unsolved
Collapse
Brand Logo
  1. Home
  2. Qt Development
  3. General and Desktop
  4. How to differentiate between tablet buttons using QTabletEvent?

How to differentiate between tablet buttons using QTabletEvent?

Scheduled Pinned Locked Moved General and Desktop
1 Posts 1 Posters 1.1k Views 1 Watching
  • Oldest to Newest
  • Newest to Oldest
  • Most Votes
Reply
  • Reply as topic
Log in to reply
This topic has been deleted. Only users with topic management privileges can see it.
  • A Offline
    A Offline
    aarmea
    wrote on last edited by
    #1

    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)!

    1 Reply Last reply
    0

    • Login

    • Login or register to search.
    • First post
      Last post
    0
    • Categories
    • Recent
    • Tags
    • Popular
    • Users
    • Groups
    • Search
    • Get Qt Extensions
    • Unsolved