-
Notifications
You must be signed in to change notification settings - Fork 693
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Alt-F4 keyboard shortcut not working with XAML island #2408
Comments
Thanks for reporting this - we are investigating, and think we may have a possible fix, but we'll do more testing. |
Can reproduce this |
affecting powertoys. |
My crude workaround was putting this before // prevent XAML islands from capturing ALT-F4 because of
// https://github.com/microsoft/microsoft-ui-xaml/issues/2408
if (msg.message == WM_SYSKEYDOWN && msg.wParam == VK_F4) [[unlikely]]
{
SendMessage(GetAncestor(msg.hwnd, GA_ROOT), msg.message, msg.wParam, msg.lParam);
continue;
} to send back the message to my hosting window. |
@sylveon that is the c++ workaround, now to see what the WPF workaround is :) |
#2481 looks to be the same issue |
If you do any processing of ALT+some key it seems that you have to the same. I just needed some special alt+space processing, and had to replace that if by As for WPF, you need to use |
Is there an update for this issue?
@Austin-Lamb That's one year ago now. |
This issue is stale because it has been open 180 days with no activity. Remove stale label or comment or this will be closed in 5 days. |
Still a problem |
Hi there -- if you're interested in moving to WinAppSDK / WinUI3, the version 1.4 stable release now includes similar islands APIs. We've got a sample in progress here: microsoft/WindowsAppSDK-Samples#307 . I've validated that ALT+F4 works fine in that sample. (Note though that the sample contains a WebView2, and ALT+F4 does not automatically work when keyboard focus is in the WebView2, sadly. (see #8058) ) |
This issue has been moved from a ticket on Developer Community.
I'm implementing a native desktop app using winrt. I'm using Visual Studio 2019 16.5.4, Windows 1909 (Build 18363.778)
Pressing Alt F4 is not working to close the application window when the application is hosting content with XAML Island and
the keyboard focus has been moved to a XAML control.
Can be reproduced with the following sample:
https://github.com/microsoft/Xaml-Islands-Samples/tree/master/Standalone_Samples/CppWinRT_Basic_Win32App
Steps to reproduce
Start the application
Click on the "Hello from Win32" content
Press Alt F4, the application close OK.
Start the application gain
Click on the "Hello from XAML island"
Press Alt FT, the application does not close.
I did not found any reference on how to handle the keyboard navigation, including handling PreTranslateMessage (using
IDesktopWindowXamlSourceNative2) to make the standard Windows behavior to work as expected.
Thanks for your time,
Pascal
Original Comments
Visual Studio Feedback System on 5/6/2020, 07:59 PM:
We have directed your feedback to the appropriate engineering team for further evaluation. The team will review the feedback and notify you about the next steps.
Original Solutions
(no solutions)
The text was updated successfully, but these errors were encountered: