Hello,
Welcome to Microsoft Q&A!
WinUI3 KeyRoutedEventArgs getting key value as Menu after clicking on alt key.
This is expected behavior. The key property of the KeyRoutedEventArgs is a Windows.System.VirtualKey Enum. As you could see in the VirtualKey Enum
document, the LeftMenu
corresponding to the left Alt key and the Menu
corresponding to the Alt key.
If you want to display Alt value in your TextBox, you might need to have a special check for the Alt key. Take keyDown event as example, you might need to check the key value before you display it, and if you found the pressed key is Menu
, then manually display the value as Alt
Thank you.
If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.