Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Open
pushkin- opened this issue Sep 10, 2024 · 0 comments
Open

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

pushkin- opened this issue Sep 10, 2024 · 0 comments
Assignees
Labels
bug Something isn't working

Comments

@pushkin-
Copy link

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

@pushkin- pushkin- added the bug Something isn't working label Sep 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants