MicrosoftEdge / MicrosoftEdge/WebView2Feedback

WebView2_PreviewKeyDown not work, WebView2_KeyDown some keys

Open
#1,196 5 comments 0 reactions 1 assignee View on GitHub

@champnic is already working on this.

Since Apr 21, 2021.

bug priority-low tracked
Dominant language
PowerShell
Stars
526
Forks
67
PR merge metrics
No merged PRs in 30d

Description

Description

WebView2_PreviewKeyDown not work.
WebView2_KeyDown only keys:
ControlKey/Apps/Menu/Capital/Escape/F1-F12/Home/End/Next/PageUp/Delete/Insert/Right/Left/Up/Down

Version
SDK: 1.0.774.44 or 1.0.824-prerelease
Runtime: 89.0.774.77 or 90.0.818.41
Framework: 4.6.1 or 4.8
OS: Win10 Pro [Version 10.0.18363.1440]

Repro Steps

    private void webView2_PreviewKeyDown(object sender, PreviewKeyDownEventArgs e)
    {
        //NOT WORK
        MessageBox.Show("previewkeydown:\n" + e.Alt + " " + e.Control + " " + e.KeyData, sender.ToString());
    }
    private void webView2r_KeyDown(object sender, KeyEventArgs e)
    {
       //ONLY ControlKey/Apps/Menu/Capital/Escape/F1-F12/Home/End/Next/PageUp/Delete/Insert/Right/Left/Up/Down
        MessageBox.Show("keydown:\n "+e.Alt + " " + e.Control + " " + e.KeyData, sender.ToString());
    }

Screenshots

Additional context

AB#32770120

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.