pub struct KeyEvent {
pub key: Key,
pub modifiers: Modifiers,
pub is_repeat: bool,
pub event_type: KeyEventType,
pub utf16_code_point: u16,
pub physical: Option<PhysicalKey>,
}Fields§
§key: Key§modifiers: Modifiers§is_repeat: bool§event_type: KeyEventTypeWhether this is a key-down or key-up event.
utf16_code_point: u16UTF-16 code point for character keys, or 0 for non-characters.
Matches Compose’s utf16CodePoint.
physical: Option<PhysicalKey>Physical key position, layout-independent. None for synthetic events.
Implementations§
Source§impl KeyEvent
impl KeyEvent
pub fn is_ctrl_pressed(&self) -> bool
pub fn is_alt_pressed(&self) -> bool
pub fn is_shift_pressed(&self) -> bool
pub fn is_meta_pressed(&self) -> bool
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 UnsafeUnpin 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