Skip to content

Unexpected Logical Key Value #11689

@Shute052

Description

@Shute052

Bevy version

The main Bevy (currently, commit #08654ad), but the bug actually comes from Bevy PR #10702: Update winit to 0.29

[Optional] Relevant system information

This might be able to reproduce on any machine in the version.

What you did

I am working on the updates of leafwing_input_manager to Bevy 0.13, but as the title says, the logical Key value seems to be incorrect.

Simple Case for Reproduction

fn main() {
    App::new()
        .add_plugins(DefaultPlugins)
        .add_systems(Update, read_keyboard_input)
        .run()
}

fn read_keyboard_input(mut keyboard_input: EventReader<KeyboardInput>) {
    for input in keyboard_input.read() {
        dbg!(input);
    }
}

What went wrong

The situation is:

  • If you just press any letter keys, e.g., W key and then you will get a KeyboardInput(logical_key: "w"), an expected lowercase w letter.
  • However, if CapsLock is activated or Shift is pressing, like normal text input, you will get a KeyboardInput(logical_key: "W"), "AN UPPERCASE W LETTER"!

Metadata

Metadata

Assignees

No one assigned

    Labels

    A-InputPlayer input via keyboard, mouse, gamepad, and moreC-BugAn unexpected or incorrect behaviorS-Needs-DesignThis issue requires design work to think about how it would best be accomplished

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions