Draft input_method support
This commit is contained in:
parent
599d8b560b
commit
7db5256b72
13 changed files with 420 additions and 27 deletions
|
|
@ -2,6 +2,7 @@
|
|||
//!
|
||||
//! [`winit`]: https://github.com/rust-windowing/winit
|
||||
//! [`iced_runtime`]: https://github.com/iced-rs/iced/tree/0.13/runtime
|
||||
use crate::core::input_method;
|
||||
use crate::core::keyboard;
|
||||
use crate::core::mouse;
|
||||
use crate::core::touch;
|
||||
|
|
@ -283,6 +284,16 @@ pub fn window_event(
|
|||
self::modifiers(new_modifiers.state()),
|
||||
)))
|
||||
}
|
||||
WindowEvent::Ime(ime) => {
|
||||
use winit::event::Ime;
|
||||
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::Commit(s) => input_method::Event::Commit(s),
|
||||
Ime::Disabled => input_method::Event::Disabled,
|
||||
}))
|
||||
}
|
||||
WindowEvent::Focused(focused) => Some(Event::Window(if focused {
|
||||
window::Event::Focused
|
||||
} else {
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue