pub enum Ime<'a> {
Enabled,
Disabled,
Preedit {
text: &'a str,
cursor: Option<(usize, usize)>,
},
Commit {
text: &'a str,
},
DeleteSurrounding {
before_bytes: usize,
after_bytes: usize,
},
}Expand description
Input Method Editor events
This enum describes input method events.
This enum closely follows the specification of winit::event::Ime,
hence its documentation may prove useful.
Variants§
Enabled
Notifies when the IME was enabled.
This may mean, for example, that a virtual keyboard is now active with focus on the recipient. This event does not mean that physical keyboard input is disabled (or that it should be ignored).
The widget should call EventState::set_ime_cursor_area immediately
and each time the area changes (relative to the widget’s coordinate
space), until Ime::Disabled is received. Failure to do so will
result in the widget’s entire rect being used as the IME cursor area.
Disabled
Notifies when the IME was disabled.
Any pending (uncommitted) pre-edit should be cleared (cancelled).
Preedit
Notifies when a new composing text should be set at the cursor position.
When text.is_empty() the pre-edit was cleared. Synthetic events with
empty text and cursor: None are generated immediately before an
Ime::Commit event.
cursor represents the selection-start and cursor indices within
text. If cursor.is_none() then no cursor should be shown.
Commit
Notifies when text should be inserted into the editor widget.
Right before this event winit will send empty Self::Preedit event.
DeleteSurrounding
Delete text surrounding the cursor or selection.
This event does not affect the pre-edit string.
Trait Implementations§
impl<'a> Eq for Ime<'a>
impl<'a> StructuralPartialEq for Ime<'a>
Auto Trait Implementations§
impl<'a> Freeze for Ime<'a>
impl<'a> RefUnwindSafe for Ime<'a>
impl<'a> Send for Ime<'a>
impl<'a> Sync for Ime<'a>
impl<'a> Unpin for Ime<'a>
impl<'a> UnwindSafe for Ime<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
impl<S, T> CastApprox<T> for Swhere
T: ConvApprox<S>,
Source§fn try_cast_approx(self) -> Result<T, Error>
fn try_cast_approx(self) -> Result<T, Error>
Source§fn cast_approx(self) -> T
fn cast_approx(self) -> T
Source§impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
impl<S, T> CastFloat<T> for Swhere
T: ConvFloat<S>,
Source§fn cast_trunc(self) -> T
fn cast_trunc(self) -> T
Source§fn cast_nearest(self) -> T
fn cast_nearest(self) -> T
Source§fn cast_floor(self) -> T
fn cast_floor(self) -> T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
Source§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.Source§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.Source§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.Source§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.Source§impl<T> DowncastSync for T
impl<T> DowncastSync for T
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.