summaryrefslogtreecommitdiff
path: root/src/macos.m
diff options
context:
space:
mode:
Diffstat (limited to 'src/macos.m')
-rw-r--r--src/macos.m12
1 files changed, 11 insertions, 1 deletions
diff --git a/src/macos.m b/src/macos.m
index 191842f6..7b248c3b 100644
--- a/src/macos.m
+++ b/src/macos.m
@@ -475,10 +475,20 @@ static iBool processScrollWheelEvent_(NSEvent *event) {
475 break; 475 break;
476 } 476 }
477 } 477 }
478 else {
479 SDL_MouseWheelEvent e = { .type = SDL_MOUSEWHEEL };
480 e.timestamp = SDL_GetTicks();
481 e.which = 1; /* Distinction between trackpad and regular mouse. */
482 /* Disregard any wheel acceleration. */
483 e.x = event.scrollingDeltaX > 0 ? 1 : event.scrollingDeltaX < 0 ? -1 : 0;
484 e.y = event.scrollingDeltaY > 0 ? 1 : event.scrollingDeltaY < 0 ? -1 : 0;
485 SDL_PushEvent((SDL_Event *) &e);
486 return iTrue;
487 }
478 /* Post corresponding MOUSEWHEEL events. */ 488 /* Post corresponding MOUSEWHEEL events. */
479 SDL_MouseWheelEvent e = { .type = SDL_MOUSEWHEEL }; 489 SDL_MouseWheelEvent e = { .type = SDL_MOUSEWHEEL };
480 e.timestamp = SDL_GetTicks(); 490 e.timestamp = SDL_GetTicks();
481 e.which = isPerPixel ? 0 : 1; /* Distinction between trackpad and regular mouse. TODO: Still needed? */ 491 e.which = isPerPixel ? 0 : 1; /* Distinction between trackpad and regular mouse. */
482 setPerPixel_MouseWheelEvent(&e, isPerPixel); 492 setPerPixel_MouseWheelEvent(&e, isPerPixel);
483 if (isPerPixel) { 493 if (isPerPixel) {
484 setInertia_MouseWheelEvent(&e, isInertia); 494 setInertia_MouseWheelEvent(&e, isInertia);