pub struct KeyboardEvent {
pub event: Event,
pub key: String,
pub code: String,
pub alt_key: bool,
pub ctrl_key: bool,
pub meta_key: bool,
pub shift_key: bool,
pub repeat: bool,
pub is_composing: bool,
}Expand description
A DOM KeyboardEvent, with the DOM’s key and code values
("Enter", "b", "KeyB", "ArrowLeft"…).
Fields§
§event: Event§key: String§code: String§alt_key: bool§ctrl_key: bool§meta_key: bool§shift_key: bool§repeat: bool§is_composing: boolMethods from Deref<Target = Event>§
Sourcepub fn prevent_default(&self)
pub fn prevent_default(&self)
preventDefault(): a cancelable event’s default action is not to
happen.
Sourcepub fn default_prevented(&self) -> bool
pub fn default_prevented(&self) -> bool
defaultPrevented.
Sourcepub fn stop_propagation(&self)
pub fn stop_propagation(&self)
stopPropagation().
Sourcepub fn propagation_stopped(&self) -> bool
pub fn propagation_stopped(&self) -> bool
Whether stopPropagation() was called.
Trait Implementations§
Source§impl Debug for KeyboardEvent
impl Debug for KeyboardEvent
Source§impl Default for KeyboardEvent
impl Default for KeyboardEvent
Source§impl Deref for KeyboardEvent
impl Deref for KeyboardEvent
Auto Trait Implementations§
impl !Freeze for KeyboardEvent
impl !RefUnwindSafe for KeyboardEvent
impl !Sync for KeyboardEvent
impl Forget for KeyboardEvent
impl Move for KeyboardEvent
impl Send for KeyboardEvent
impl Unpin for KeyboardEvent
impl UnsafeUnpin for KeyboardEvent
impl UnwindSafe for KeyboardEvent
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