#[non_exhaustive]pub struct KeyEvent {
pub vk: u32,
pub mods: u32,
pub down: bool,
pub repeat: bool,
pub scancode: u32,
pub location: u32,
}Expand description
(E2) a key as it went down or up, for a canvas that passes the keyboard on (a web page’s keydown / keyup events): ui.key_event_take
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.vk: u32VK_*
mods: u32MOD_* at the time
down: booldown (true) or up
repeat: boola down of the system’s auto-repeat while the key is held
scancode: u32the key’s place on the keyboard, whatever the layout: Windows’ scan code (0xE0.. for extended keys), Linux’s evdev code; 0 where the platform does not tell (macOS, the browser, Android)
location: u32KL_STANDARD, KL_LEFT / KL_RIGHT (the two Shift, Ctrl, Alt, Windows keys), KL_NUMPAD
Trait Implementations§
impl Copy for KeyEvent
impl Eq for KeyEvent
impl StructuralPartialEq for KeyEvent
Auto Trait Implementations§
impl Forget for KeyEvent
impl Freeze for KeyEvent
impl Move 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