Skip to content

scan_code and virtual_key_code are swapped #2092

@Woyten

Description

@Woyten

https://github.com/rust-windowing/winit/blob/master/src/platform_impl/web/web_sys/event.rs considers event.key_code()/event.char_code() to be the scan_code of the KeyboardInput event and event.code() to be the virtual_key_code of the KeyboardInput event while it should be the other way around.

How to verify yourself: Use the links given below and a German keyboard layout and press the German z key

Demonstration of workaround in my personal project: Woyten/tune@38b7ecd and Woyten/tune@fcec2d3

Metadata

Metadata

Assignees

No one assigned

    Labels

    DS - webAffects the Web backend (WebAssembly/WASM)

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions