MicrosoftEdge / MicrosoftEdge/WebView2Feedback

[Feature]: Allow ShortcutKeyDescription to be Set on CoreWebView2ContextMenuItem

Open
#4,727 5 comments 2 reactions 1 assignee View on GitHub

@Lakshmisha-KS is already working on this.

Since Feb 12, 2025.

feature request
Dominant language
PowerShell
Stars
526
Forks
67
PR merge metrics
No merged PRs in 30d

Description

Describe the feature/enhancement you need

I'm currently working on a WPF application where I need to override the context menu.
This has been fairly straightforward so far, but I cannot work out how to specify a keyboard shortcut to be displayed on the menu item.

I would like the shortcuts to appear the same as the default menu:
image

The CoreWebView2ContextMenuItem.ShortcutKeyDescription property is read only.
The CoreWebView2ContextMenuItem.Label property documentation suggests that it "Will contain an ampersand for characters to be used as keyboard accelerator."

I've tried eg. "MyCommandLabel&Ctrl+H" but the shortcut is just incorporated into the label.

Am I missing something? Is it done this way due to localization?
It would be much easier to be able to override the property value with Set.

The scenario/use case where you would use this feature

It's important for accessibility considerations and for "power users" to be able to specify the keyboard capabilities of the given commands,

How important is this request to you?

Impactful. My app's user experience would be significantly compromised without it.

Suggested implementation

No response

What does your app do? Is there a pending deadline for this request?

No response

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.