summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlexander Weiss <ik@alexanderweiss.nl>2019-01-26 16:34:32 +0100
committerMichael Lutz <michi@icosahedron.de>2019-02-24 17:54:59 +0100
commit77ab6f8ec7e68fc83b752a4fdfa2a673ca5fa9b4 (patch)
tree7dd60876b2c20f7cd754f86f106b10e557dbfea5
parent0bb395b21db53d65e195c59d9995a0fb4fa74463 (diff)
downloadopenttd-77ab6f8ec7e68fc83b752a4fdfa2a673ca5fa9b4.tar.xz
Change: [OSX] Prevent 2D scrolling for traditional scroll wheel mice
-rw-r--r--src/video/cocoa/event.mm5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/video/cocoa/event.mm b/src/video/cocoa/event.mm
index 77f683af8..de812a70d 100644
--- a/src/video/cocoa/event.mm
+++ b/src/video/cocoa/event.mm
@@ -581,7 +581,10 @@ static bool QZ_PollEvent()
/* Use precise scrolling-specific deltas if they're supported. */
#if (MAC_OS_X_VERSION_MAX_ALLOWED >= MAC_OS_X_VERSION_10_7)
- if ([event respondsToSelector:@selector(scrollingDeltaX)]) {
+ if ([event respondsToSelector:@selector(hasPreciseScrollingDeltas)]) {
+ /* No precise deltas indicates a scroll wheel is being used, so we don't want 2D scrolling. */
+ if (![ event hasPreciseScrollingDeltas ]) break;
+
deltaX = [ event scrollingDeltaX ] * 0.5f;
deltaY = [ event scrollingDeltaY ] * 0.5f;
} else