Skip to content

Windows WASM: Hitting AltGr sends additional Ctrl event #4555

@LeonMatthes

Description

@LeonMatthes

Description

I'm using winit in the Browser on Windows with Wasm. Every time I hit the ALT-GR key on my German keyboard layout, winit sends a control key press first and then an ALT-GR key press.

A comment in another issue hints to winit already handling this as a special case on native windows so likely the same heuristic needs to be used in Wasm:
#3012 (comment)

Log Output

Occurs when pressing and releasing AltGr (Only logging KeyEvents for brevity)

Winit: KeyEvent { physical_key: Code(ControlLeft), logical_key: Named(Control), text: None, location: Left, state: Pressed, repeat: false, platform_specific: KeyEventExtra } slint_lsp_wasm.js:1220:21
Winit: KeyEvent { physical_key: Code(AltRight), logical_key: Named(AltGraph), text: None, location: Right, state: Pressed, repeat: false, platform_specific: KeyEventExtra } slint_lsp_wasm.js:1220:21
Winit: KeyEvent { physical_key: Code(ControlLeft), logical_key: Named(Control), text: None, location: Left, state: Released, repeat: false, platform_specific: KeyEventExtra } slint_lsp_wasm.js:1220:21
Winit: KeyEvent { physical_key: Code(AltRight), logical_key: Named(AltGraph), text: None, location: Right, state: Released, repeat: false, platform_specific: KeyEventExtra } slint_lsp_wasm.js:1220:21

Windows version

Microsoft Windows [Version 10.0.26200.8037]

Tested with:
Firefox 149.0.2
MS Edge Version 146.0.3856.109 (Official build) (64-bit)

Winit version

0.30.2

Metadata

Metadata

Assignees

No one assigned

    Labels

    B - bugDang, that shouldn't have happenedDS - win32Affects the Win32/Windows backend

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions