Details
-
Task
-
Resolution: Unresolved
-
P3: Somewhat important
-
None
-
6.5
-
None
Description
This feature has always been missing. Last time I looked, it seemed that we would need to wait for the tablet move event that comes after the proximity-enter, because the position info (etc) is missing from the proximity-enter event itself. And so, we've never been able to deliver TabletEnterProximity events to the appropriate QWindow: you have to subclass Q(Gui)Application to get the events (as in qtbase/examples/widgets/widgets/tablet/tabletapplication.cpp) or install an event filter (as in qtbase/tests/auto/gui/kernel/qwindow/tst_qwindow.cpp).
While we're at it, we can add whatever else we can get, and remove as many Q_UNUSED as possible from this:
bool QWindowSystemInterface::handleTabletEnterLeaveProximityEvent(QWindow *window, ulong timestamp, const QPointingDevice *device, bool inProximity, const QPointF &local, const QPointF &global, Qt::MouseButtons buttons, int xTilt, int yTilt, qreal tangentialPressure, qreal rotation, int z, Qt::KeyboardModifiers modifiers) { Q_UNUSED(window); Q_UNUSED(local); Q_UNUSED(global); Q_UNUSED(buttons); Q_UNUSED(xTilt); Q_UNUSED(yTilt); Q_UNUSED(tangentialPressure); Q_UNUSED(rotation); Q_UNUSED(z); Q_UNUSED(modifiers); return inProximity ? handleWindowSystemEvent<QWindowSystemInterfacePrivate::TabletEnterProximityEvent>(timestamp, device) : handleWindowSystemEvent<QWindowSystemInterfacePrivate::TabletLeaveProximityEvent>(timestamp, device); } class TabletEnterProximityEvent : public PointerEvent { public: // TODO store more info: position and whatever else we can get on most platforms TabletEnterProximityEvent(ulong time, const QPointingDevice *device) : PointerEvent(nullptr, time, TabletEnterProximity, Qt::NoModifier, device) { } }; class TabletLeaveProximityEvent : public PointerEvent { public: // TODO store more info: position and whatever else we can get on most platforms TabletLeaveProximityEvent(ulong time, const QPointingDevice *device) : PointerEvent(nullptr, time, TabletLeaveProximity, Qt::NoModifier, device) { } };
If we can deliver the proximity events to the window, it will be much easier to make use of them in Qt Quick.
Attachments
Issue Links
- relates to
-
QTBUG-77508 No tablet events received if pen is close to surface on application start
- Reported
-
QTBUG-42156 OS X: wacom tablets with touch don't generate any touch events
- Reported
-
QTBUG-47841 Genius GPen 560 tablet doesn't produce any Proximity events on Linux
- Reported
-
QTBUG-70558 Scroll jump after using stylus
- Open
-
QTBUG-62912 Hover is not reset properly with touchscreens
- Closed
-
QTBUG-65200 macOS: Using setCursor() inside tabletEvent() handler doesn't work unless the pen is pressed against the tablet
- Closed
-
QTBUG-65559 Wacom tablet with pen, mouse tracking
- Closed
- resulted from
-
QTBUG-72173 Refactor the QEvent hierarchy to make input events more like QQuickPointerEvents in Qt 6
- Closed
Gerrit Reviews
For Gerrit Dashboard: QTBUG-111400 | ||||||
---|---|---|---|---|---|---|
# | Subject | Branch | Project | Status | CR | V |
490939,2 | WIP try to send tablet proximity events with complete information | dev | qt/qtwayland | Status: NEW | -2 | 0 |
556126,4 | Include QPointingDevice with enter/leave events; clear points on leave | dev | qt/qtbase | Status: NEW | 0 | 0 |