Skip to content

Commit

Permalink
Fix events piling up and causing duplicate key presses (#70)
Browse files Browse the repository at this point in the history
  • Loading branch information
rparrett authored Aug 23, 2024
1 parent 999bb19 commit 31378db
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -337,7 +337,7 @@ impl<'w, 's> InnerText<'w, 's> {
fn keyboard(
key_input: Res<ButtonInput<KeyCode>>,
input_events: Res<Events<KeyboardInput>>,
input_reader: Local<ManualEventReader<KeyboardInput>>,
mut input_reader: Local<ManualEventReader<KeyboardInput>>,
mut text_input_query: Query<(
Entity,
&TextInputSettings,
Expand Down Expand Up @@ -466,6 +466,8 @@ fn keyboard(
});
}
}

input_reader.clear(&input_events);
}

fn update_value(
Expand Down

0 comments on commit 31378db

Please sign in to comment.