pub struct KeyEvent { /* private fields */ }
Expand description
An event associated with a key press
Implementations§
source§impl KeyEvent
impl KeyEvent
sourcepub fn char(&self) -> Option<char>
pub fn char(&self) -> Option<char>
Returns the character corresponding to the key associated with this event, if one exists
Some key combinations, including combinations with non-Shift modifiers, may not have corresponding characters.
sourcepub fn control_pressed(&self) -> bool
pub fn control_pressed(&self) -> bool
Returns true if the control key was held down when the action occurred
sourcepub fn option_pressed(&self) -> bool
pub fn option_pressed(&self) -> bool
Returns true if the option/alt key was held down when the action occurred
sourcepub fn shift_pressed(&self) -> bool
pub fn shift_pressed(&self) -> bool
Returns true if a shift key was held down when the action occurred
Trait Implementations§
Auto Trait Implementations§
impl Freeze for KeyEvent
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