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<String>,
}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<String>Physical key position (KeyW, Digit1, Space, … — winit
KeyCode debug names, layout-independent). None for
synthetic events (gamepad-emulated keys, tests). Games bind by
position the way GML’s ord("W") binds the US position, so
non-US layouts move the same; the key glyph stays the
text-entry/shortcut path.
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