summaryrefslogtreecommitdiffstats
path: root/src/plugins/platforms/cocoa/qnsview.h
diff options
context:
space:
mode:
authorMorten Johan Sørvig <morten.sorvig@qt.io>2016-12-07 12:52:52 +0100
committerShawn Rutledge <shawn.rutledge@qt.io>2017-04-24 09:19:31 +0000
commit8bc36c773faf3bc3d68731d9cfafaf6caf2c0783 (patch)
tree83b3a6f2a01ba9b82b0969e04ce5e254818cca37 /src/plugins/platforms/cocoa/qnsview.h
parent148188fef36dc96b9ebc090e3986f7fd203cf834 (diff)
Cocoa: Send correct mouse buttons for tablets
Tablet vendors allow user configurable pen buttons where the user may assign a logical mouse button to a given physical button. In the case of Wacom tablets this mapping is not reflected in the buttonMask API, which returns the state of the physical buttons. Use NSEvent buttonNummber instead, which returns the logical button number, after applying user mappings. Unifiy button state stacking with the mouse handlers. Handle a special case where buttonNumber returns 0 for tablet right mouse presses. We get these events via rightMouse* event handlers and can hardcode the button number. Change-Id: I06b9b1aa98c49b84f7e3871e694c22c7ad0169d6 Task-number: QTBUG-57487 Task-number: QTBUG-54160 Reviewed-by: Shawn Rutledge <shawn.rutledge@qt.io>
Diffstat (limited to 'src/plugins/platforms/cocoa/qnsview.h')
-rw-r--r--src/plugins/platforms/cocoa/qnsview.h6
1 files changed, 3 insertions, 3 deletions
diff --git a/src/plugins/platforms/cocoa/qnsview.h b/src/plugins/platforms/cocoa/qnsview.h
index 75a508370f..a78151ebbe 100644
--- a/src/plugins/platforms/cocoa/qnsview.h
+++ b/src/plugins/platforms/cocoa/qnsview.h
@@ -116,9 +116,9 @@ Q_FORWARD_DECLARE_OBJC_CLASS(QT_MANGLE_NAMESPACE(QNSViewMouseMoveHelper));
- (void)resetMouseButtons;
- (void)handleMouseEvent:(NSEvent *)theEvent;
-- (bool)handleMouseDownEvent:(NSEvent *)theEvent;
-- (bool)handleMouseDraggedEvent:(NSEvent *)theEvent;
-- (bool)handleMouseUpEvent:(NSEvent *)theEvent;
+- (bool)handleMouseDownEvent:(NSEvent *)theEvent withButton:(int)buttonNumber;
+- (bool)handleMouseDraggedEvent:(NSEvent *)theEvent withButton:(int)buttonNumber;
+- (bool)handleMouseUpEvent:(NSEvent *)theEvent withButton:(int)buttonNumber;
- (void)mouseDown:(NSEvent *)theEvent;
- (void)mouseDragged:(NSEvent *)theEvent;
- (void)mouseUp:(NSEvent *)theEvent;