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
quit.
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
design choice.
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 :).
-Will
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
stand point).