Add listening to Escape and 'Q' keys to close Win32 sample window

このコミットが含まれているのは:
Michael A. Hawker committed 2021-11-07 14:21:25 -08:00
1 親 9feaae0d86
コミット 3695ca3fac
1ファイル変更
+6
+6
ファイルの表示
@@ -148,6 +148,12 @@ internal unsafe static class Win32ApplicationRunner
{
Thread.Sleep(100);
}
// Also listen to Escape and 'Q' to Quit.
if (msg.message == Windows.WM_KEYUP && (msg.wParam == Windows.VK_ESCAPE || msg.wParam == 0x51))
{
_ = Windows.DestroyWindow(hwnd);
}
}
tokenSource.Cancel();