Struct i_slint_core::input::KeyEvent
source · #[repr(C)]pub struct KeyEvent {
pub modifiers: KeyboardModifiers,
pub text: SharedString,
pub event_type: KeyEventType,
pub preedit_selection_start: usize,
pub preedit_selection_end: usize,
}Expand description
Represents a key event.
Fields§
§modifiers: KeyboardModifiersThe keyboard modifiers active at the time of the key press event.
text: SharedStringThe unicode representation of the key pressed.
event_type: KeyEventTypeIndicates whether the key was pressed or released
preedit_selection_start: usizeIf the event type is KeyEventType::UpdateComposition, then this field specifies the start of the selection as byte offsets within the preedit text.
preedit_selection_end: usizeIf the event type is KeyEventType::UpdateComposition, then this field specifies the end of the selection as byte offsets within the preedit text.
Implementations§
source§impl KeyEvent
impl KeyEvent
sourcepub fn shortcut(&self) -> Option<StandardShortcut>
pub fn shortcut(&self) -> Option<StandardShortcut>
If a shortcut was pressed, this function returns Some(StandardShortcut).
Otherwise it returns None.
sourcepub fn text_shortcut(&self) -> Option<TextShortcut>
pub fn text_shortcut(&self) -> Option<TextShortcut>
If a shortcut concerning text editing was pressed, this function
returns Some(TextShortcut). Otherwise it returns None.
Trait Implementations§
source§impl PartialEq<KeyEvent> for KeyEvent
impl PartialEq<KeyEvent> for KeyEvent
impl StructuralPartialEq for KeyEvent
Auto Trait Implementations§
impl RefUnwindSafe for KeyEvent
impl Send for KeyEvent
impl !Sync for KeyEvent
impl Unpin for KeyEvent
impl UnwindSafe for KeyEvent
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
Mutably borrows from an owned value. Read more