[SDL] Alt-F4 not working on Windows

Christoph Kobe christoph at kobenetz.de
Sat May 3 11:16:23 PDT 2008


On Sat, 3 May 2008 10:46:01 -0700 (PDT)
Mason Wheeler <masonwheeler at yahoo.com> wrote:
> ----- Original Message ----
> From: Christoph Kobe <christoph at kobenetz.de>
> To: sdl at libsdl.org
> Sent: Saturday, May 3, 2008 9:47:43 AM
> Subject: Re: [SDL] Alt-F4 not working on Windows
> 
> >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.
> Because SDL hooks the keyboard input at a low enough level that it receives the keypresses before the window manager does.  <ALT>-<F4> is defined as a menu shortcut for the Close command in the window's system menu, and then the Close command generates a WM_DESTROY message.  But since the window manager never gets the keypress, the shortcut can't be activated.  (Opening the system menu with the mouse and selecting Close works just fine.)

Thanks, this is something I was expecting. But since ALT-TAB and CTRL-ALT-DEL still work one could say that this is a flaw in the Windows operating system / window manager. Easy enough to blame Microsoft for this :-)

-- 
Christoph
from Hamburg, Germany



More information about the SDL mailing list