[SDL] Alt-F4 not working on Windows

Christoph Kobe christoph at kobenetz.de
Sat May 3 09:47:43 PDT 2008


On Sat, 03 May 2008 17:36:21 +0100
"Graham Houston" <graham.houston at rushpark.co.uk> wrote:

> On Sat, 03 May 2008 17:23:53 +0100, Christoph Kobe <christoph at kobenetz.de>  
> wrote:
> 
> > 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.
> >
> 
> And if I want ALT-F4 on Windows to not close the window but do something  
> else ?? im buggered!!

You could as well try to use ALT-TAB or CTRL-ALT-DEL in your application but these are pre-defined key in windows and as well is ALT-F4. It's very poor design using ALT-F4 on windows for anything else than quitting the program.

> 
> if this was to be implemented in SDL then you can bet your ass than many  
> programs that already exist and use ALT-F4 for other reasons will not work  
> as expected.. instead of doing what was intended of the combo it quits the  
> program!!! this would be a bug!!
> 
> and on other systems its the same story regardless you mixing up user  
> interface ethics with bugs here! if you want ALT-F4 to call WM_DESTROY
> catch the combo and pump the SDL_QUIT event.

My main question still is: Why is ALT-F4 in the SDL not generating a WM_DESTROY event? With every other program this is working fine, so there has to be something that prevents the event. I'm not insisting that this is a bug (although I think so) but I'm asking WHY.

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


-- 
Christoph
from Hamburg, Germany



More information about the SDL mailing list