src/video/cocoa/SDL_cocoawindow.m
changeset 1957 c7803e4c21d3
parent 1956 ba0d62354872
child 1958 5fc6fb0fb605
     1.1 --- a/src/video/cocoa/SDL_cocoawindow.m	Sat Jul 29 21:51:00 2006 +0000
     1.2 +++ b/src/video/cocoa/SDL_cocoawindow.m	Sat Jul 29 22:42:48 2006 +0000
     1.3 @@ -208,26 +208,22 @@
     1.4      }
     1.5  
     1.6      point = [NSEvent mouseLocation];
     1.7 -    if (point.x < rect.origin.x ||
     1.8 -        point.x > (rect.origin.x + rect.size.width) ||
     1.9 -        point.y < rect.origin.y ||
    1.10 -        point.y > (rect.origin.y + rect.size.height)) {
    1.11 -        if (window->flags & SDL_WINDOW_MOUSE_FOCUS) {
    1.12 -            SDL_SendWindowEvent(_data->windowID, SDL_WINDOWEVENT_LEAVE, 0, 0);
    1.13 -        }
    1.14 -    } else {
    1.15 -        if (!(window->flags & SDL_WINDOW_MOUSE_FOCUS)) {
    1.16 -            SDL_SendWindowEvent(_data->windowID, SDL_WINDOWEVENT_ENTER, 0, 0);
    1.17 -        }
    1.18 -    }
    1.19      point.x = point.x - rect.origin.x;
    1.20      point.y = rect.size.height - (point.y - rect.origin.y);
    1.21      SDL_SendMouseMotion(index, 0, (int)point.x, (int)point.y);
    1.22  }
    1.23  
    1.24 +- (void)mouseDragged:(NSEvent *)theEvent
    1.25 +{
    1.26 +    [self mouseMoved:theEvent];
    1.27 +}
    1.28 +
    1.29  - (void)scrollWheel:(NSEvent *)theEvent
    1.30  {
    1.31 -fprintf(stderr, "scrollWheel\n");
    1.32 +    int index;
    1.33 +
    1.34 +    index = _data->videodata->mouse;
    1.35 +    SDL_SendMouseWheel(index, (int)([theEvent deltaY]+0.9f));
    1.36  }
    1.37  
    1.38  - (void)keyDown:(NSEvent *)theEvent