Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 5 additions & 12 deletions desktop/src/app.rs
Original file line number Diff line number Diff line change
Expand Up @@ -312,7 +312,6 @@ impl App {
// [NA] TODO: This event used to give a single char. `last()` is functionally the same,
// but we may want to be better at this in the future.
let key_char = event.text.clone().and_then(|text| text.chars().last());
let mut allow_text = true;

match &event.state {
ElementState::Pressed => {
Expand All @@ -324,7 +323,11 @@ impl App {
self.player.handle_event(PlayerEvent::TextControl {
code: control_code,
});
allow_text = false;
} else if let Some(text) = event.text {
for codepoint in text.chars() {
self.player
.handle_event(PlayerEvent::TextInput { codepoint });
}
}
}
ElementState::Released => {
Expand All @@ -333,16 +336,6 @@ impl App {
}
};
check_redraw = true;

if allow_text {
if let Some(text) = event.text {
for codepoint in text.chars() {
self.player
.handle_event(PlayerEvent::TextInput { codepoint });
}
check_redraw = true;
}
}
}
_ => (),
}
Expand Down