Take the tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

I am writing a game (FPS-style) using SDL that I would like to run in windowed mode. I would like to trap the mouse cursor in the window, but I would like to be able to alt-tab out of the game, so I would like keyboard input to still run through the window manager before the game sees it. I am running linux.

Currently I have the following in my code:

SDL_WM_GrabInput ( SDL_GRAB_ON );

This successfully grabs the mouse, but also grabs the keyboard and my window manager's alt-tab is not working.

Any solutions?

share|improve this question
add comment

Know someone who can answer? Share a link to this question via email, Google+, Twitter, or Facebook.

Your Answer

 
discard

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

Browse other questions tagged or ask your own question.