pub struct KeyPress {
pub key: Key,
pub modified_key: Key,
pub physical_key: Physical,
pub modifiers: Modifiers,
pub text: Option<SmolStr>,
pub is_focused: bool,
}Expand description
A key press.
Fields§
§key: KeyThe original key pressed without modifiers applied to it.
You should use this key for combinations (e.g. Ctrl+C).
modified_key: KeyThe key pressed with modifiers applied to it.
You should use this key for any single key bindings (e.g. motions).
physical_key: PhysicalThe physical key pressed.
You should use this key for layout-independent bindings.
modifiers: ModifiersThe state of the keyboard modifiers.
text: Option<SmolStr>The text produced by the key press.
is_focused: boolWhether the Editor is focused.
Trait Implementations§
impl Eq for KeyPress
impl StructuralPartialEq for KeyPress
Auto Trait Implementations§
impl Freeze for KeyPress
impl RefUnwindSafe for KeyPress
impl Send for KeyPress
impl Sync for KeyPress
impl Unpin for KeyPress
impl UnsafeUnpin for KeyPress
impl UnwindSafe for KeyPress
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