summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa
diff options
context:
space:
mode:
authorShawn Rutledge <shawn.rutledge@digia.com>2014-07-28 15:17:48 +0200
committerShawn Rutledge <shawn.rutledge@digia.com>2014-07-31 12:21:08 +0200
commit9a096cba223936c81c2c3392265681c78e63617e (patch)
treef6ce3fccc75b114abde5be603bbbd827891fb657 /src/plugins/platforms/cocoa
parentda9e02eb83ea6eecf3cdb16b11241c91f5029380 (diff)
OS X: add buttons to tablet events
Task-number: QTBUG-39458 Change-Id: I112107e392bf3b55771039b72271fdf887e2e5db Reviewed-by: Frederik Gladhorn <frederik.gladhorn@digia.com>
Diffstat (limited to 'src/plugins/platforms/cocoa')
-rw-r--r--src/plugins/platforms/cocoa/qnsview.mm15
1 files changed, 13 insertions, 2 deletions
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm
index 66ef16d2b3..2b437240df 100644
--- a/src/plugins/platforms/cocoa/qnsview.mm
+++ b/src/plugins/platforms/cocoa/qnsview.mm
@@ -66,6 +66,8 @@
#include <accessibilityinspector.h>
#endif
+Q_LOGGING_CATEGORY(lcQpaTablet, "qt.qpa.tabletsupport")
+
static QTouchDevice *touchDevice = 0;
// ### HACK Remove once 10.8 is unsupported
@@ -994,6 +996,7 @@ Q_GLOBAL_STATIC(QCocoaTabletDeviceDataHash, tabletDeviceDataHash)
NSPoint tilt = [theEvent tilt];
int xTilt = qRound(tilt.x * 60.0);
int yTilt = qRound(tilt.y * -60.0);
+ Qt::MouseButtons buttons = static_cast<Qt::MouseButtons>(static_cast<uint>([theEvent buttonMask]));
qreal tangentialPressure = 0;
qreal rotation = 0;
int z = 0;
@@ -1007,8 +1010,13 @@ Q_GLOBAL_STATIC(QCocoaTabletDeviceDataHash, tabletDeviceDataHash)
Qt::KeyboardModifiers keyboardModifiers = [QNSView convertKeyModifiers:[theEvent modifierFlags]];
- QWindowSystemInterface::handleTabletEvent(m_window, timestamp, down, windowPoint, screenPoint,
- deviceData.device, deviceData.pointerType, pressure, xTilt, yTilt,
+ qCDebug(lcQpaTablet, "event on tablet %d with tool %d type %d unique ID %lld pos %6.1f, %6.1f root pos %6.1f, %6.1f buttons 0x%x pressure %4.2lf tilt %d, %d rotation %6.2lf",
+ deviceId, deviceData.device, deviceData.pointerType, deviceData.uid,
+ windowPoint.x(), windowPoint.y(), screenPoint.x(), screenPoint.y(),
+ static_cast<uint>(buttons), pressure, xTilt, yTilt, rotation);
+
+ QWindowSystemInterface::handleTabletEvent(m_window, timestamp, windowPoint, screenPoint,
+ deviceData.device, deviceData.pointerType, buttons, pressure, xTilt, yTilt,
tangentialPressure, rotation, z, deviceData.uid,
keyboardModifiers);
}
@@ -1100,6 +1108,9 @@ static QTabletEvent::TabletDevice wacomTabletDevice(NSEvent *theEvent)
tabletDeviceDataHash->remove(deviceId);
}
+ qCDebug(lcQpaTablet, "proximity change on tablet %d: current tool %d type %d unique ID %lld",
+ deviceId, deviceData.device, deviceData.pointerType, deviceData.uid);
+
if (entering) {
QWindowSystemInterface::handleTabletEnterProximityEvent(timestamp, deviceData.device, deviceData.pointerType, deviceData.uid);
} else {