Sigh, was busy for a few days and took a while to catch up on the
thread, heh! It's been nice to see a variety of views.
First off, if ya don't process the SDL_QUIT event, then clicking on
the close action doesn't kill the program, only a nice hard 'kill -9'
appropriate to whatever OS you're running will do the trick (task
manager, etc). SDL receives the shutdown request and passes said
request to the app as an SDL_QUIT. It's up to the application to
Secondly, ALT-F4 is a windows convention. SDL is multiplatform. If
the OS/WM doesn't send a QUIT command to the application on a given
keypress, why should SDL assume the user's intention ? You're
typically never directly in contact with the hardware and there's
always some form of abstraction these days, if a convention was to be
enforced, I'd imagine it'd be done there (below SDL). If your game
desires to run under Windows, then adding your own quick check for
ALT-F4 is quick an easy, which can then call an SDL_PushEvent() for
SDL_QUIT (or however you wish to reduce duplicate code in your app).
Second-point-fively, if we're going to follow OS convention, then
should SDL also implement CTRL-C and CTRL-V under Windows for
clipboard controls ? Those are much more common key presses, and much
more likely to be used in a game. Most OS/WM stuff offer clipboards,
too. Lets not forget copying an IP address and pasting it into an FPS
/connect console command :). Is clipboard control less system level
than a windows close ? How about drag and drop ? I remember when these
things became major additions to xfree window managers. And lets not
forget the mention of ALT-TAB via Darwinia.
Third, Sam suggested a post on bugtraq. This doesn't necessarily mean
he's condoned it as a full blown bug that needs to be fixed... it more
or less means it should be looked at, discussed, and decided upon. A
metaphor could be drawn with prosecution, where the police may arrest
someone but not necessarily post charges. Arresting them is just part
of procedure with the full course of action yet to be determined.
Fourth, standards compliant fun. Fun because both sides of the fence
are right :). In the case of games, media players, etc where the
keyboard isn't used as a typical text entry device, a give key layout
might lend itself more comfortably to a set of input controls. I do
know that, when writing my in-house multiplatform apps, I prefer the
keyboard layout of the tool to be the same across each supported
platform, rather than having to hopscotch around several OS/WM
conventions. I'll also admit that there are times when not having the
suggested action occur from a given input event doesn't yield the
suggested outcome, I'm thrown back the first couple times until I
learn how to do what's needed. Is it MY RIGHT as a user to have
things perform the same way across all applications of my given OS ?
Or is it MY RIGHT as a user to have the application perform the same
across any OS ? Or, as a developer, is it MY RIGHT to have the
application perform as I see is best ? Or is this even a rights issue
at all ? I, personally, don't see it as a rights issue. It's a
File, Edit, Help have been Windows menuing mainstays for over a
decade, and they're proposed/suggested menuing guidelines. In games
they don't make much sense. Long ago, I remember reading a (possibly
Dovorak) article saying how it doesn't fit alot of regular commercial
apps as well.
As mentioned in an earlier thread by myself and also mentioned by
other ppl, an SDL_foo library to handle this is probably the best
approach.... or an entire underbelly of the event handler (not
necessarily just keyboard level, there could be a time where some
other input device is relavent) that also keeps an eye out for
relevant OS/WM input-events that should be reacted upon. Then the fun
argument of if you keep backwards code compatibility with the 'old'
way of doing things and offer an _Init(), environment, etc ... or...
if you force the new way upon the developers, requiring them to
disable it if they see fit (and possibly patch their existing projects
if they want to) ?
Just to reiterate, a design choice - not something to be forced down
our throats - in my opinion :).
PS: "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."
--- I've always wondered why we can reboot any home PC/Mac with a
keyboard combination when we can't verify who's at the keyboard. Yes,
that's a security question in 'when do you give up all trust', but..
still seems dangerous and sloppy to me :) (even from a non-security