Skip to content

Commit

Permalink
Fix: Backspace not working after IME input (#4912)
Browse files Browse the repository at this point in the history
Fix: Changed the handling method of `Ime::Preedit(_, None)`

Fix: backspace fail after ime input

* Related #4358
* Related #4430 
* Related #4436
* Related #4794 
* Related #4896
* Closes #4908 

Issues: backspace fail after ime input
* #4908 (Chinese)

Changed the handling method of `Ime::Preedit(_, None)`
  • Loading branch information
rustbasic authored Aug 5, 2024
1 parent 71dbc48 commit 76fe6c8
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions crates/egui-winit/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -341,8 +341,7 @@ impl State {
// We use input_method_editor_started to manually insert CompositionStart
// between Commits.
match ime {
winit::event::Ime::Enabled => {}
winit::event::Ime::Preedit(_, None) => {
winit::event::Ime::Enabled => {
self.ime_event_enable();
}
winit::event::Ime::Preedit(text, Some(_cursor)) => {
Expand All @@ -357,7 +356,7 @@ impl State {
.push(egui::Event::Ime(egui::ImeEvent::Commit(text.clone())));
self.ime_event_disable();
}
winit::event::Ime::Disabled => {
winit::event::Ime::Disabled | winit::event::Ime::Preedit(_, None) => {
self.ime_event_disable();
}
};
Expand Down

0 comments on commit 76fe6c8

Please sign in to comment.