-
-
Notifications
You must be signed in to change notification settings - Fork 4k
Open
Labels
A-InputPlayer input via keyboard, mouse, gamepad, and morePlayer input via keyboard, mouse, gamepad, and moreC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorD-StraightforwardSimple bug fixes and API improvements, docs, test and examplesSimple bug fixes and API improvements, docs, test and examplesO-LinuxSpecific to the Linux desktop operating systemSpecific to the Linux desktop operating systemS-Needs-InvestigationThis issue requires detective work to figure out what's going wrongThis issue requires detective work to figure out what's going wrong
Description
Bevy version
0.15.1
Relevant system information
- rustc 1.82.0 (f6e511eec 2024-10-15)
- Ubuntu 24.04 LTS
What you did
use bevy::{input::keyboard::KeyboardInput, prelude::*};
use bevy::input::ButtonState;
fn main() {
App::new()
.add_plugins(DefaultPlugins)
.add_systems(Update, print_keyboard_event_system)
.run();
}
fn print_keyboard_event_system(mut keyboard_input_events: EventReader<KeyboardInput>) {
for event in keyboard_input_events.read() {
if event.state == ButtonState::Pressed {
println!("{:?}", event.key_code);
}
}
}
What went wrong
Ran the code above and pressed any keyboard button on Ubuntu 24.04 using Bevy 0.15.1, the ButtonState::Pressed event triggers twice.
Additional information
Short discussion on Discord that spawned this issue: https://discord.com/channels/691052431525675048/742569353878437978/1326850835044368467
Metadata
Metadata
Assignees
Labels
A-InputPlayer input via keyboard, mouse, gamepad, and morePlayer input via keyboard, mouse, gamepad, and moreC-BugAn unexpected or incorrect behaviorAn unexpected or incorrect behaviorD-StraightforwardSimple bug fixes and API improvements, docs, test and examplesSimple bug fixes and API improvements, docs, test and examplesO-LinuxSpecific to the Linux desktop operating systemSpecific to the Linux desktop operating systemS-Needs-InvestigationThis issue requires detective work to figure out what's going wrongThis issue requires detective work to figure out what's going wrong