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