Sign in to follow this  
Ancient Spirit

Disabling RWin, LWin, Alt-Tab

Recommended Posts

A crowbar, and some anaesthesics for the keyboard.

While RWin/LWin are a hassle when you press them by mistake, Alt-Tab is used by users to revert to another application. By removing this shortcut, you are not being very friendly to your users. Also, removing Alt-Tab does not serve any useful purpose at all, aside from maybe annoying your users, since even then, you would still have to write code for focus loss that occurs in many other cases that cannot be prevented, such as a message box from another program appearing and stealing focus from your application, which can lead to death of your application (if the user is lucky) or, more often, a deadlock where the screen displays your fullscreen application, but all user input goes to another window (where only killing your game can solve anything).

The standard way is to detect loss of focus by receiving the appropriate message from windows, stop doing anything not strictly necessary (rendering, for instance), putting the game on pause (if possible) and wait for focus to return in order to resume the game to a playable state.

If you are still willing to remove those keys, use the forum search, as this topic is discussed once per week or so, and very good answers have already been given.

Share this post


Link to post
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

Sign in to follow this