I am playing Wolfenstein: Enemy Territory, and when I play it in windowed mode, I can't change focus from the game to something else (Alt+Tab doesn't work).
I am playing Wolfenstein: Enemy Territory, and when I play it in windowed mode, I can't change focus from the game to something else (Alt+Tab doesn't work).
I had similar experience with Unreal Tournament 2004. Eventually I have found that pressing Esc (thus switching to game menu) released keyboard grab and I could alt-tab.
Unfortunately, lot of games seem to not behave in a desktop-friendly fashion, exclusively grabbing keyboard and mouse during the action. This effectively disables any interaction of the user with the desktop: he can't use his window manager (alt-tab is the most common example), he can't use his desktop-wide keyboard shortcuts (e.g. control music player), he can't answer IM, etc.
It looks like there is no clean solution to this issue, except that redesigning affected games themselves. (Though some hacks with forbidding keyboard grabs using
LD_PRELOAD
may be relevant).You can try to assign a shortcut to a script like this:
change gedit for the name of your game
Step by step instructions:
We will need XDoTooland Compiz (You can install these from the software center or by clicking here)
Make a file
.unmap.sh
in your home folder.Paste the script mentioned above into it:
Make it executable (Here's how to do that).
Open Compiz (Menu > System > Preferences > CompizConfig Manager)
Go to Commands and add
~/.unmap.sh
to one commandThen go to Keybindings and make a shortcut for it.
Ctrl+Alt+X, where X is a number from 7 and up, will switch you to a different user's X session (if you have kernel modesetting, which is supported only by open-source drivers).
For example, I usually run ioquake3 in a different user account without compiz and autostarted apps and stuff. If I log in to my main user account first and then log in to my gaming account, I can switch to the main account from the game by pressing Ctrl+Alt+7 and back to the game by pressing Ctrl+Alt+8.
The main drawback in this method is that you'll have to enter your password each time you switch, regardless of any settings, and not all games survive this. Windows games are particularly naughty in these cases, even in Windows they tend to screw up the display and/or input if they lose focus.
I haven't tried this with that specific game, but Ctrl+G frees up the mouse for a lot of games.
I found one way, it works for Wolf:ET, it may help with other games too, if you turn on gameconsole (usually tilde key) game will release mouse lock (in windowed mode).