pub struct KeyboardEvent {
pub kbd: KBDLLHOOKSTRUCT,
pub wm_key_state: WmKeyState,
}Expand description
Represents a single keyboard event received via a Windows low-level keyboard hook.
Internally contains the raw Windows KBDLLHOOKSTRUCT and the associated event type
(e.g., key down or key up).
Fields§
§kbd: KBDLLHOOKSTRUCTThe raw Windows keyboard event structure.
wm_key_state: WmKeyStateThe raw Windows keyboard event structure.
Implementations§
Source§impl KeyboardEvent
impl KeyboardEvent
Sourcepub fn virtual_key(&self) -> VIRTUAL_KEY
pub fn virtual_key(&self) -> VIRTUAL_KEY
Returns the virtual key code of the event.
Sourcepub fn duration_since(&self, earlier: &Self) -> Duration
pub fn duration_since(&self, earlier: &Self) -> Duration
Returns the duration elapsed since the given earlier event.
Trait Implementations§
Source§impl Clone for KeyboardEvent
impl Clone for KeyboardEvent
impl Copy for KeyboardEvent
Source§impl Debug for KeyboardEvent
impl Debug for KeyboardEvent
Source§impl MenuTriggerEvent for KeyboardEvent
impl MenuTriggerEvent for KeyboardEvent
Returns the corresponding
MenuTrigger for the key event. Read moreSource§fn is_key_down(&self) -> bool
fn is_key_down(&self) -> bool
Returns
true if the key is currently pressed. (Default implementation provided.)Source§impl PartialEq for KeyboardEvent
impl PartialEq for KeyboardEvent
impl StructuralPartialEq for KeyboardEvent
Auto Trait Implementations§
impl Freeze for KeyboardEvent
impl RefUnwindSafe for KeyboardEvent
impl Send for KeyboardEvent
impl Sync 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