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.