mirror of
https://github.com/microsoft/PowerToys
synced 2024-11-22 00:03:48 +00:00
Make Alt-F4 always close the settings window (#334)
Fixes: https://github.com/microsoft/PowerToys/issues/289
This commit is contained in:
parent
8ac6db8b5a
commit
1737128b1d
@ -239,6 +239,12 @@ void initialize_win32_webview(HWND hwnd, int nCmdShow) {
|
||||
std::wstring message_sent = args_script_notify.Value().c_str();
|
||||
receive_message_from_webview(message_sent);
|
||||
});
|
||||
webview_control.AcceleratorKeyPressed([&](IWebViewControl sender, WebViewControlAcceleratorKeyPressedEventArgs const& args) {
|
||||
if (args.VirtualKey() == winrt::Windows::System::VirtualKey::F4) {
|
||||
// WebView swallows key-events. Detect Alt-F4 one and close the window manually.
|
||||
webview_control.InvokeScriptAsync(hstring(L"exit_settings_app"), {});
|
||||
}
|
||||
});
|
||||
resize_web_view();
|
||||
#if defined(_DEBUG) && _DEBUG_WITH_LOCALHOST
|
||||
// navigates to localhost:8080
|
||||
|
Loading…
Reference in New Issue
Block a user