Skip to content

[Problem/Bug]: Shift and Enter key doesn't trigger KeyDown and KeyUp #4802

Open
@pushkin-

Description

@pushkin-

What happened?

I have a KeyDown and KeyUp handler that is trying to detect hotkeys. I have some hotkeys with the Shift key. When the Shift key is let go of, I want to trigger the key up and send a message to my webapp to handle the hotkey.

Howevver, the Shift key being depressed doesn't trigger the KeyUp event.

So when I have a hotkey like ctrl+alt+shift+e, if the shift key is the first key that's let go of, we don't detect it and instead think that the hotkey is ctrl+alt+e (once one of the other keys is let go of). So I need to let go of one of the other keys first for the hotkey to get triggered.

Similarly, I have a hotkey with chords, e.g. ctrl+a shift+b. We can detect ctrl+a fine, but shift+b isn't detected.

Also, I observered the the Enter key also doesn't trigger the keydown/up events.

Passing --enable-features=msWebView2BrowserHitTransparent to the webview2 control fixes the issue but then it also breaks other keys. So for example, tabbing between fields is now broken. It's like I have to handle it myself and send it to the webview2 control? Not sure.

Similar to this issue, though not quite the same #2245

Importance

Important. My app's user experience is significantly compromised.

Runtime Channel

Stable release (WebView2 Runtime)

Runtime Version

128.0.2739.67

SDK Version

1.0.2535.41

Framework

Winforms

Operating System

Windows 11

OS Version

22631.4037

Repro steps

  1. add a KeyDown and KeyUp event handler to the webview2 control and press shift or enter and compare to pressing ctrl

Repros in Edge Browser

No, issue does not reproduce in the corresponding Edge version

Regression

No, this never worked

Last working version (if regression)

No response

AB#54365248

Metadata

Metadata

Assignees

Labels

bugSomething isn't workingtrackedWe are tracking this work internally.

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions