[SDL] Alt-F4 not working on Windows

Scott Harper orcein at gmail.com
Fri May 2 18:48:52 PDT 2008


>>> alt-f4 for games under windows - especially full screen games, often
>>> do NOT close the program.
>>>
>>> Games get you out of the windows, and take over the computer.  You
>>> don't have the same look, or feel with windows games - no  
>>> conventions
>>> should apply :)
>
>
>> How about for a program that is in windowed mode rather than  
>> fullscreen?
>>
>
> That would be a suitable situation, however I just don't see that  
> any of
> this has anything to do with a problem in SDL rather the game/app
> developer not applying the appropriate behaviour. SDL does not exit  
> when
> you click the [x] icon either, you have to trap it and write the quit
> routine yourself... just like the ALT-F4 key combo!!!

Of COURSE SDL doesn't exit when you click the X button!  The program  
itself needs to clean up its memory and close when that happens!   
FORCING the SDL program to quit would just be stupid because what if  
you have open files, or data that needs saving?  SDL has NO idea what  
the designer needs to do before quitting the program.  Maybe the  
designer wants to ask the user if he's sure he wants to quit, and just  
forcing the game to shutdown would DESTROY that sort of thing.

Thus my argument that there's rather very little point in forcing Alt- 
F4 to generate an SDL_QUIT event.  You still have to capture the event  
and handle it yourself, and this limits your ability to make sensical  
control schemes.  Yes, yes, it wouldn't be THAT hard to come up with a  
different control scheme under Windows than Linux/Mac, but I like the  
idea that one game will be the same under all platforms.  Games aren't  
web browsers.  They have different UIs, different cursors, and there's  
never been any need for a game to look like it belongs on a given  
platform versus any other given platform.  So why, then, must every  
game adhere to the standards set forth by Microsoft years ago?  A  
standard which, by the way, many games DO choose to ignore.

Thus, I feel it is not a bug in SDL to not generate an SDL_QUIT event  
when Alt-F4 is pressed.  I have no objection to making a new event,  
something which addresses this specific way of closing a program.

However, in the interest of completeness, is Alt-F4 supposed to quit  
the WHOLE PROGRAM, or just close the top window?

Incidentally, there is no equivalent to this "feature" under Mac OS  
for closing programs; and on a "me as a user" level, I've always felt  
Alt-F4 to be a rather dated, obscure relic which, once moved into the  
world of modern OS and UI design is too archaic to bother with.

my_two_cents++;

-- Scott


More information about the SDL mailing list