src/video/cocoa/SDL_cocoamouse.m
changeset 9257 6f41196c2d6b
parent 9087 eef2e43f60d1
child 9619 b94b6d0bff0f
     1.1 --- a/src/video/cocoa/SDL_cocoamouse.m	Wed Dec 03 10:55:23 2014 -0500
     1.2 +++ b/src/video/cocoa/SDL_cocoamouse.m	Sun Nov 23 21:09:54 2014 -0500
     1.3 @@ -399,6 +399,13 @@
     1.4  
     1.5      float x = -[event deltaX];
     1.6      float y = [event deltaY];
     1.7 +    SDL_MouseWheelDirection direction = SDL_MOUSEWHEEL_NORMAL;
     1.8 +
     1.9 +    if ([event respondsToSelector:@selector(isDirectionInvertedFromDevice)]) {
    1.10 +        if ([event isDirectionInvertedFromDevice] == YES) {
    1.11 +            direction = SDL_MOUSEWHEEL_FLIPPED;
    1.12 +        }
    1.13 +    }
    1.14  
    1.15      if (x > 0) {
    1.16          x += 0.9f;
    1.17 @@ -410,7 +417,7 @@
    1.18      } else if (y < 0) {
    1.19          y -= 0.9f;
    1.20      }
    1.21 -    SDL_SendMouseWheel(window, mouse->mouseID, (int)x, (int)y);
    1.22 +    SDL_SendMouseWheel(window, mouse->mouseID, (int)x, (int)y, direction);
    1.23  }
    1.24  
    1.25  void