From 668025c23902ddf1c020c18172a34aec357c9bc4 Mon Sep 17 00:00:00 2001 From: "Ryan C. Gordon" Date: Sat, 24 May 2014 18:23:39 -0400 Subject: [PATCH] Implement SDL_CaptureMouse() for Mac OS X. --- src/video/cocoa/SDL_cocoamouse.m | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/video/cocoa/SDL_cocoamouse.m b/src/video/cocoa/SDL_cocoamouse.m index f5b54ed38..2f9d8d352 100644 --- a/src/video/cocoa/SDL_cocoamouse.m +++ b/src/video/cocoa/SDL_cocoamouse.m @@ -274,6 +274,14 @@ Cocoa_SetRelativeMouseMode(SDL_bool enabled) return 0; } +static int +Cocoa_CaptureMouse(SDL_Window *window) +{ + /* our Cocoa event code already tracks the mouse outside the window, + so all we have to do here is say "okay" and do what we always do. */ + return 0; +} + void Cocoa_InitMouse(_THIS) { @@ -287,6 +295,7 @@ Cocoa_InitMouse(_THIS) mouse->FreeCursor = Cocoa_FreeCursor; mouse->WarpMouse = Cocoa_WarpMouse; mouse->SetRelativeMouseMode = Cocoa_SetRelativeMouseMode; + mouse->CaptureMouse = Cocoa_CaptureMouse; SDL_SetDefaultCursor(Cocoa_CreateDefaultCursor());