microsoft / microsoft-ui-xaml

Windows UI Library: the latest Windows 10 native controls and Fluent styles for your applications
MIT License
6.29k stars 675 forks source link

InkCanvas does not recognize keyboard accelerator for context menu (ie. Shift+F10) #5246

Closed greedyAI closed 1 year ago

greedyAI commented 3 years ago

Describe the bug The InkCanvas control responds to right clicks when subscribed to the ContextRequested property, but does not respond to the functionally equivalent Shift+F10 keyboard accelerator.

Steps to reproduce the bug

  1. Create a new UWP C++/C# project and add a MenuFlyout under MainPage.xaml's Page.Resources
  2. Add a InkCanvas control to the root Grid control and have its ContextRequested property trigger a function in the code behind (say, OnContextRequested).
  3. In the code behind for MainPage.xaml for OnContextRequested, make the MenuFlyout appear (eg. using the MenuFlyout.ShowAt API).
  4. Build the app (Debug x64 for example) and press Shift+F10 on the keyboard. Observe the lack of response.

Expected behavior The MenuFlyout context menu should appear.

Version Info NuGet package version: 2.6.0-prerelease.210524002

Windows app type: UWP Win32
Yes
Windows 10 version Saw the problem?
Insider Build Yes
October 2020 Update (19042)
May 2020 Update (19041)
November 2019 Update (18363)
May 2019 Update (18362)
October 2018 Update (17763)
April 2018 Update (17134)
Fall Creators Update (16299)
Creators Update (15063)
Device form factor Saw the problem?
Desktop Yes
Xbox
Surface Hub
IoT

Additional context This bug appears on an insider build for WinUI 2.6. For specific information about the build, please contact me at waley.zhang@microsoft.com.

StephenLPeters commented 3 years ago

@greedyAI is this issue new to winui2.6? I wouldn't expect that to be the case, I'd guess this is present in system xaml as well?

@JesseCol / @Austin-Lamb thoughts on why shift+F10 wouldn't raise the event? Seems like InkCanvas is probably getting first crack at the keyboard event.

greedyAI commented 3 years ago

Hi @StephenLPeters, I don't think this issue is new to WinUI 2.6. I tested it on an vanilla app for WinUI 2.4 and it also reproed. I reckon this bug may have to do with how the InkPresenter deals with its InputDeviceTypes on your end.

StephenLPeters commented 3 years ago

Thanks, @JesseCol @Austin-Lamb and @MikeHillberg who might also know whats going on.

github-actions[bot] commented 1 year ago

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.