Quit via File -> Exit / Alt+F4 instead of Escape
Escape was a leftover spike convenience that quit the tool. Esc is a common in-game key, so dropping it from a borderless mirror was too easy to do by accident. Remove the Escape-quit handler and add a File -> Exit menu item (shown with its Alt+F4 shortcut). Alt+F4 already worked via DefWindowProc -> WM_CLOSE -> WM_DESTROY; the menu item sets a one-shot flag the main loop reads. Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
This commit is contained in:
@@ -204,14 +204,10 @@ LRESULT CALLBACK D3D11Window::wnd_proc(HWND hwnd, UINT msg, WPARAM wparam, LPARA
|
||||
self->resize_height_ = HIWORD(lparam);
|
||||
}
|
||||
return 0;
|
||||
case WM_KEYDOWN:
|
||||
// Spike convenience: Esc quits so we aren't stuck in a borderless window.
|
||||
if (wparam == VK_ESCAPE)
|
||||
{
|
||||
PostQuitMessage(0);
|
||||
}
|
||||
return 0;
|
||||
case WM_DESTROY:
|
||||
// Reached by the close button, Alt+F4 (DefWindowProc turns it into WM_CLOSE ->
|
||||
// DestroyWindow), and our own teardown. Esc deliberately does NOT quit -- it's a
|
||||
// common in-game key, so quitting is via the File -> Exit menu item or Alt+F4.
|
||||
PostQuitMessage(0);
|
||||
return 0;
|
||||
default:
|
||||
|
||||
Reference in New Issue
Block a user