diff options
author | Liang Qi <liang.qi@qt.io> | 2018-01-04 19:49:26 +0100 |
---|---|---|
committer | Liang Qi <liang.qi@qt.io> | 2018-01-04 19:49:26 +0100 |
commit | 79dfc084375e52dde283e6b046b5894198e9f6a2 (patch) | |
tree | 564ecca27993eafb920fa7597adb23c28132081e /src/plugins/platforms/cocoa | |
parent | 6efbd4381ade816515bbde59f9d31df0241e1340 (diff) | |
parent | 952c4fa25180e5f6180067bc8edd2abe6d81d053 (diff) |
Merge remote-tracking branch 'origin/5.10' into dev
Change-Id: I644cd82b0d952b7d139e0228bf5017f147db77e7
Diffstat (limited to 'src/plugins/platforms/cocoa')
-rw-r--r-- | src/plugins/platforms/cocoa/qnsview.mm | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/plugins/platforms/cocoa/qnsview.mm b/src/plugins/platforms/cocoa/qnsview.mm index 33f9527213..2aed7078b7 100644 --- a/src/plugins/platforms/cocoa/qnsview.mm +++ b/src/plugins/platforms/cocoa/qnsview.mm @@ -886,6 +886,8 @@ Q_GLOBAL_STATIC(QCocoaTabletDeviceDataHash, tabletDeviceDataHash) - (bool)handleTabletEvent: (NSEvent *)theEvent { + static bool ignoreButtonMapping = qEnvironmentVariableIsSet("QT_MAC_TABLET_IGNORE_BUTTON_MAPPING"); + if (!m_platformWindow) return false; @@ -934,14 +936,15 @@ Q_GLOBAL_STATIC(QCocoaTabletDeviceDataHash, tabletDeviceDataHash) rotation -= 360.0; Qt::KeyboardModifiers keyboardModifiers = [QNSView convertKeyModifiers:[theEvent modifierFlags]]; + Qt::MouseButtons buttons = ignoreButtonMapping ? static_cast<Qt::MouseButtons>(static_cast<uint>([theEvent buttonMask])) : m_buttons; 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>(m_buttons), pressure, xTilt, yTilt, rotation); + static_cast<uint>(buttons), pressure, xTilt, yTilt, rotation); QWindowSystemInterface::handleTabletEvent(m_platformWindow->window(), timestamp, windowPoint, screenPoint, - deviceData.device, deviceData.pointerType, m_buttons, pressure, xTilt, yTilt, + deviceData.device, deviceData.pointerType, buttons, pressure, xTilt, yTilt, tangentialPressure, rotation, z, deviceData.uid, keyboardModifiers); return true; |