Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Is it possible to unlock the mouse in fullscreen mode so that you can use it on a another monitor? I read trough the SDL documentation, but I couldn't find anything related to my problem.

share|improve this question
It's likely you don't want to use "real" fullscreen, but "fake" fullscreen (full size borderless window). See this question on SO and maybe it'll help you:… – Tetrad Feb 27 '13 at 22:05
I didn't need to do anything special to support this when I did exactly this, yesterday, testing on OSX using SDL version 2.0.2. Had a fullscreen window on one monitor, not set to capture the mouse, and I was able to freely move the mouse back to the other monitor and interact with windows there. What you're seeing might be platform-specific behaviour? (In which case, you should specify what platform you're working on) – Trevor Powell Apr 10 '14 at 4:36

This is for SDL 2, but have you showing the cursor cursor and seeing if it can escape?

function for creating a cursor:

int SDL_ShowCursor(int toggle)    

so it would be like this


look more into it here:

personally I do not have a second monitor so I cannot help you

share|improve this answer

In SDL 2 there is also SDL_Get/SetWindowGrab which returns/sets whether or not the window is grabbing the mouse. I think this is what you want.

share|improve this answer

For SDL2 (don't use SDL1 anymore):

// to configure the window
SDL_SetWindowFullscreen(my_window, SDL_WINDOW_FULLSCREEN_DESKTOP);

// to unlock the mouse
SDL_SetWindowGrab(my_window, false);

// to lock the mouse
SDL_SetWindowGrab(my_window, true);

That first sets the window to the "fake" fullscreen that is just a resolution-sized borderless window. This is necessary on Windows and some Linux setups to have a mouse cursor that can freely enter and leave the window on a multi-monitor setup.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.