[SDL] Alt-F4 not working on Windows
Jonathan Dearborn
grimfang4 at hotmail.com
Wed Apr 30 18:57:41 PDT 2008
That's what I was gonna say: If you specifically code to catch the conventional alt-F4, then your program will not follow the conventions on other systems (i.e. no longer multi-OS-friendly). But if alt-F4 does generate an SDL_QUIT event, I think it would be tougher to work around than having to use preprocessor directives in the other case. Despite this, my personal preference would be to send SDL_QUIT... Someone should make the call on this, but until then, preprocessor is the way to go. Just add an #ifdef __WIN32__ or something.
Jonny D
Date: Wed, 30 Apr 2008 19:36:37 -0400
From: welshjf at gmail.com
To: sdl at lists.libsdl.org
Subject: Re: [SDL] Alt-F4 not working on Windows
That's the point. Alt-F4 is part of the operating system's interface;
that should not concern the programmer any more than "minimize" or
Alt-Tab. If you check for Alt-F4 events yourself, you're making the
unreasonable assumption that all operating systems supported by SDL
have this convention, which is not the case. On Linux it is perfectly
reasonable for the user to remap Alt-F4 to something else, and have
some other shortcut for "close".
On Linux, the Close button, Alt-F4, Ctrl+C, SIGTERM etc. all generate
an SDL_QUIT event; I assume this is also the intended behavior on
Windows, and it ought to be if it's not.
Abhinav Lele wrote:
Mason,
Why do you presume Alt+F4 to be a quit trigger. Here is an example.
Blender. Famous 3D design application. Although blender traps alt+f4,
but if you look the shortcut given for exit in its menu, it shows Ctrl
+ Q.
SDL has to be generic you cannot always assume that Alt+F4 is quit.
If that's what has to be done, then IMO it hasn't been fixed. <ALT>-<F4> is a Windows standard. It always means "quit" on every program. (A few games I've seen override this behavior, which I consider very poor design.) Since by default, <ALT>-<F4> means "quit", it should always generate a SDL_QUIT event, not a SDL_KEYDOWN event. (Same goes for <Command>-Q on Macs.)
_______________________________________________
SDL mailing list
SDL at lists.libsdl.org
http://lists.libsdl.org/listinfo.cgi/sdl-libsdl.org
--
Jacob Welsh
TJHSST, Class of 2008
welshjf at gmail.com | http://www.tjhsst.edu/~jwelsh/
_________________________________________________________________
Express yourself wherever you are. Mobilize!
http://www.gowindowslive.com/Mobile/Landing/Messenger/Default.aspx?Locale=en-US?ocid=TAG_APRIL
-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.libsdl.org/pipermail/sdl-libsdl.org/attachments/20080430/316e03d3/attachment.htm
More information about the SDL
mailing list