[SDL] Alt-F4 not working on Windows

Christoph Kobe christoph at kobenetz.de
Sat May 3 09:23:53 PDT 2008


On Sat, 03 May 2008 16:59:30 +0100
"Graham Houston" <graham.houston at rushpark.co.uk> wrote:

> On Sat, 03 May 2008 16:49:27 +0100, Christoph Kobe <christoph at kobenetz.de>  
> wrote:
> 
> > What part of the SDL does actually prevent the WM_DESTROY event that  
> > every other windows program gets when I hit ALT-F4?
> >
> 
> none, you just have to catch the ALT-F4 key combo and do what you must...

This is not true since every other windows program will get a WM_DESTROY event if you hit ALT-F4 or if you press the [X] icon. If you were right every other windows program would have to catch keyboard events and look for ALT_F4, but this is done (AFAIK) by the window manager and not by the application.

> if ALT-F4 caused the SDL_QUIT event then how do you tell the difference  
> between a SDL_QUIT that was caused by the [X] icon and the key combo?

This is true, you would not be able to tell the difference from the view of the SDL app. But why should one care how the Program closes? I think you can't tell either if your program was terminated by clicking [X] or by using the task manager to terminate the process. But that's the point, there are several ways to terminate a Program (ALT-F4, [X], Taskmanager, etc.) but all a windows program gets is the WM_DESTROY message.
> it  
> just gets very obscure and silly.. nothing here is broken, if you want  
> ALT-F4 to close the app/game then just catch the key combo and do what you  
> do for SDL_QUIT event... simple!

It's not that simple because on other systems I don't want ALT_F4 to terminate the program but to use that systems key combination, which can be different from ALT-F4.

> 
> 
> Graham.
> 
> -- 
> Using Opera's revolutionary e-mail client: http://www.opera.com/mail/


-- 
Christoph
from Hamburg, Germany



More information about the SDL mailing list