Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

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).

share|improve this question
add comment

5 Answers

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).

share|improve this answer
add comment

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.

share|improve this answer
    
Did you mean F7 and F8 keys, instead of numeral 7 and 8? –  ulidtko Apr 26 '11 at 8:07
    
I think he indeed means F7 and F8, i described same "solution" in original post some time ago, but also wrote Ctrl+Alt+1 instead of F1. –  GrizzLy Apr 26 '11 at 13:22
    
Yes, F7, F8 and so on. Sorry. –  Shnatsel Apr 27 '11 at 21:28
add comment

I haven't tried this with that specific game, but Ctrl+G frees up the mouse for a lot of games.

share|improve this answer
add comment
up vote 0 down vote accepted

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).

share|improve this answer
add comment

You can try to assign a shortcut to a script like this:

#!/bin/bash
#
# by desgua
#
# To unmap a  windowed game
xdotool search --class gedit windowunmap
exit 0  

change gedit for the name of your game

Step by step instructions:

  1. We will need XDoTooland Compiz (You can install these from the software center or by clicking here)

  2. Make a file .unmap.sh in your home folder.

  3. Paste the script mentioned above into it:

  4. Make it executable (Here's how to do that).

  5. Open Compiz (Menu > System > Preferences > CompizConfig Manager)

  6. Go to Commands and add ~/.unmap.sh to one command

  7. Then go to Keybindings and make a shortcut for it.

share|improve this answer
    
The script has been fixed. –  desgua Apr 25 '11 at 13:12
add comment

Your Answer

 
discard

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.