Skip to content

Unexpected Logical Key Value #3453

@Shute052

Description

@Shute052

Reported in Bevy issue #11689, the problem arises with the winit dependency at version 0.29.2. As a newcomer to winit, I'm struggling to create a reproduction case for it, which is quite unfortunate.

I've included the Bevy converter below, designed to transform winit Keys into their owns:

pub fn convert_logical_key(logical_key_code: &winit::keyboard::Key) -> bevy_input::keyboard::Key {
    match logical_key_code {
        winit::keyboard::Key::Character(s) => bevy_input::keyboard::Key::Character(s.clone()),
        // Other cases are also straightforward one-to-one mappings
    }
}

From my perspective, a logical key should remain consistent regardless of external factors.
However, the situation is that the 'W' key reporting a lowercase 'w' normally and an uppercase 'W' when CapsLock is activated or Shift is pressed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions