by keevie · 9y ago · 0 comments
Alt-F4 makes little sense, true, but in almost all windows apps control-q or control-w does exactly the same thing as on osx.
Also, having sane defaults for keys people are likely to press is much more important than /not/ having obscure keyboard shortcuts that users never have to know even exist.
In particular, if you have unsaved data, most apps will prompt to save on Alt+F4.
However, Alt+F4 translating to WM_CLOSE is also handled by the app message loop - i.e. Windows sends WM_KEYDOWN events for those keys, and when they get to the event loop, it's supposed to call TranslateMessage. That one normally handles WM_KEYDOWN -> WM_CHAR translation, but it will also handle any shortcuts, and this includes Alt+F4. So if the app is hanging, messages aren't pumped, and the shortcut doesn't work. To send WM_CLOSE, you'd need to use the close button on the window.
So if the app does close on Alt+F4, it was, at the minimum, pumping messages and invoking TranslateMessage on them.
Launching processes with a single keypress and no confirmation can hardly be called "the least destructive action."