egui/data/input/ime_event.rs
1/// IME event.
2///
3/// See <https://docs.rs/winit/latest/winit/event/enum.Ime.html>
4#[derive(Clone, Debug, Eq, PartialEq)]
5#[cfg_attr(feature = "serde", derive(serde::Deserialize, serde::Serialize))]
6pub enum ImeEvent {
7 /// Notifies when the IME was enabled.
8 #[deprecated = "No longer used by egui"]
9 Enabled,
10
11 /// A new IME candidate is being suggested.
12 ///
13 /// An empty preedit string indicates that the IME has been dismissed, while
14 /// a non-empty preedit string indicates that the IME is active.
15 Preedit {
16 text: String,
17 active_range_chars: Option<core::ops::Range<usize>>,
18 },
19
20 /// IME composition ended with this final result.
21 ///
22 /// The IME is considered dismissed after this event.
23 Commit(String),
24
25 /// Notifies when the text surrounding the cursor should be deleted.
26 ///
27 /// `before_chars` and `after_chars` are the number of characters (not
28 /// bytes) to delete before and after the cursor, respectively.
29 DeleteSurrounding {
30 before_chars: usize,
31 after_chars: usize,
32 },
33
34 /// Notifies when the IME was disabled.
35 #[deprecated = "No longer used by egui"]
36 Disabled,
37}