Implement SDL_CaptureMouse() for Mac OS X.
authorRyan C. Gordon <icculus@icculus.org>
Sat, 24 May 2014 18:23:39 -0400
changeset 8928f60f16d29e37
parent 8927 be64f5daf64b
child 8929 7b459b49fa92
Implement SDL_CaptureMouse() for Mac OS X.
src/video/cocoa/SDL_cocoamouse.m
     1.1 --- a/src/video/cocoa/SDL_cocoamouse.m	Sat May 24 01:30:37 2014 -0400
     1.2 +++ b/src/video/cocoa/SDL_cocoamouse.m	Sat May 24 18:23:39 2014 -0400
     1.3 @@ -274,6 +274,14 @@
     1.4      return 0;
     1.5  }
     1.6  
     1.7 +static int
     1.8 +Cocoa_CaptureMouse(SDL_Window *window)
     1.9 +{
    1.10 +    /* our Cocoa event code already tracks the mouse outside the window,
    1.11 +        so all we have to do here is say "okay" and do what we always do. */
    1.12 +    return 0;
    1.13 +}
    1.14 +
    1.15  void
    1.16  Cocoa_InitMouse(_THIS)
    1.17  {
    1.18 @@ -287,6 +295,7 @@
    1.19      mouse->FreeCursor = Cocoa_FreeCursor;
    1.20      mouse->WarpMouse = Cocoa_WarpMouse;
    1.21      mouse->SetRelativeMouseMode = Cocoa_SetRelativeMouseMode;
    1.22 +    mouse->CaptureMouse = Cocoa_CaptureMouse;
    1.23  
    1.24      SDL_SetDefaultCursor(Cocoa_CreateDefaultCursor());
    1.25