#[non_exhaustive]pub struct KeyboardDetail {
pub key: String,
pub modifiers: KeyboardModifiers,
pub repeat: bool,
}Expand description
keydown / keypress / keyup payload.
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.key: StringDOM KeyboardEvent.key — the printable character or named
key value ("Enter", "ArrowLeft", "a", "F5", …).
Translation from crossterm::KeyCode lives in
rdom-tui::tui_event::key_translate (M4a step 7).
modifiers: KeyboardModifiersModifiers held during the press.
repeat: booltrue for OS-generated repeats of a held key.
Implementations§
Source§impl KeyboardDetail
impl KeyboardDetail
Sourcepub fn new(key: impl Into<String>, modifiers: KeyboardModifiers) -> Self
pub fn new(key: impl Into<String>, modifiers: KeyboardModifiers) -> Self
A key payload (KeyboardEventInit) for key with modifiers,
not a repeat.
Sourcepub fn with_repeat(self, repeat: bool) -> Self
pub fn with_repeat(self, repeat: bool) -> Self
Set repeat (an OS-generated repeat of a held key).
Trait Implementations§
Source§impl Clone for KeyboardDetail
impl Clone for KeyboardDetail
Source§impl Debug for KeyboardDetail
impl Debug for KeyboardDetail
impl Eq for KeyboardDetail
Source§impl Hash for KeyboardDetail
impl Hash for KeyboardDetail
Source§impl PartialEq for KeyboardDetail
impl PartialEq for KeyboardDetail
impl StructuralPartialEq for KeyboardDetail
Auto Trait Implementations§
impl Freeze for KeyboardDetail
impl RefUnwindSafe for KeyboardDetail
impl Send for KeyboardDetail
impl Sync for KeyboardDetail
impl Unpin for KeyboardDetail
impl UnsafeUnpin for KeyboardDetail
impl UnwindSafe for KeyboardDetail
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