diff --git a/include/SDL_events.h b/include/SDL_events.h index 0b848b944..fc5a145e7 100644 --- a/include/SDL_events.h +++ b/include/SDL_events.h @@ -257,8 +257,8 @@ typedef struct SDL_MouseWheelEvent Uint32 timestamp; Uint32 windowID; /**< The window with mouse focus, if any */ Uint32 which; /**< The mouse instance id, or SDL_TOUCH_MOUSEID */ - Sint32 x; /**< The amount scrolled horizontally */ - Sint32 y; /**< The amount scrolled vertically */ + Sint32 x; /**< The amount scrolled horizontally, positive to the right and negative to the left */ + Sint32 y; /**< The amount scrolled vertically, positive away from the user and negative toward the user */ } SDL_MouseWheelEvent; /** diff --git a/src/video/cocoa/SDL_cocoamouse.m b/src/video/cocoa/SDL_cocoamouse.m index 98b0e6161..56f679632 100644 --- a/src/video/cocoa/SDL_cocoamouse.m +++ b/src/video/cocoa/SDL_cocoamouse.m @@ -291,7 +291,7 @@ Cocoa_HandleMouseWheel(SDL_Window *window, NSEvent *event) { SDL_Mouse *mouse = SDL_GetMouse(); - float x = [event deltaX]; + float x = -[event deltaX]; float y = [event deltaY]; if (x > 0) {