Copy winit docs for input_method::Event

This commit is contained in:
Héctor Ramón Jiménez 2025-02-02 17:55:16 +01:00
parent 0c6d4eb23f
commit d5ee9c2795
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
2 changed files with 68 additions and 13 deletions

View file

@ -289,7 +289,10 @@ pub fn window_event(
println!("ime event: {:?}", ime);
Some(Event::InputMethod(match ime {
Ime::Enabled => input_method::Event::Enabled,
Ime::Preedit(s, size) => input_method::Event::Preedit(s, size),
Ime::Preedit(s, size) => input_method::Event::Preedit(
s,
size.map(|(start, end)| (start..end)),
),
Ime::Commit(s) => input_method::Event::Commit(s),
Ime::Disabled => input_method::Event::Disabled,
}))