Draft input_method support

This commit is contained in:
KENZ 2025-01-10 07:12:31 +09:00 committed by Héctor Ramón Jiménez
parent 599d8b560b
commit 7db5256b72
No known key found for this signature in database
GPG key ID: 7CC46565708259A7
13 changed files with 420 additions and 27 deletions

24
core/src/input_method.rs Normal file
View file

@ -0,0 +1,24 @@
//! Listen to input method events.
/// A input method event.
///
/// _**Note:** This type is largely incomplete! If you need to track
/// additional events, feel free to [open an issue] and share your use case!_
///
/// [open an issue]: https://github.com/iced-rs/iced/issues
#[derive(Debug, Clone, PartialEq, Eq)]
pub enum Event {
// These events correspond to underlying winit ime events.
// https://docs.rs/winit/latest/winit/event/enum.Ime.html
/// the IME was enabled.
Enabled,
/// new composing text should be set at the cursor position.
Preedit(String, Option<(usize, usize)>),
/// text should be inserted into the editor widget.
Commit(String),
/// the IME was disabled.
Disabled,
}