pub struct WinHotKeyEvent {
pub id: u32,
pub state: HotKeyState,
}Expand description
Describes a global hotkey event emitted when a HotKey is pressed or released.
Fields§
§id: u32Id of the associated HotKey.
state: HotKeyStateState of the associated HotKey.
Implementations§
Source§impl WinHotKeyEvent
impl WinHotKeyEvent
Sourcepub fn state(&self) -> HotKeyState
pub fn state(&self) -> HotKeyState
Returns the state of the associated HotKey.
Sourcepub fn receiver<'a>() -> &'a WinHotKeyEventReceiver
pub fn receiver<'a>() -> &'a WinHotKeyEventReceiver
Gets a reference to the event channel’s WinHotKeyEventReceiver
which can be used to listen for global hotkey events.
§Note
This will not receive any events if WinHotKeyEvent::set_event_handler has been called with a Some value.
Sourcepub fn set_event_handler<F: Fn(WinHotKeyEvent) + Send + Sync + 'static>(
f: Option<F>,
)
pub fn set_event_handler<F: Fn(WinHotKeyEvent) + Send + Sync + 'static>( f: Option<F>, )
Set a handler to be called for new events. Useful for implementing custom event sender.
§Note
Calling this function with a Some value,
will not send new events to the channel associated with WinHotKeyEvent::receiver
Trait Implementations§
Source§impl Clone for WinHotKeyEvent
impl Clone for WinHotKeyEvent
Source§fn clone(&self) -> WinHotKeyEvent
fn clone(&self) -> WinHotKeyEvent
Returns a copy of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for WinHotKeyEvent
impl Debug for WinHotKeyEvent
Source§impl Ord for WinHotKeyEvent
impl Ord for WinHotKeyEvent
Source§fn cmp(&self, other: &WinHotKeyEvent) -> Ordering
fn cmp(&self, other: &WinHotKeyEvent) -> Ordering
1.21.0 · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the maximum of two values. Read more
Source§impl PartialEq for WinHotKeyEvent
impl PartialEq for WinHotKeyEvent
Source§impl PartialOrd for WinHotKeyEvent
impl PartialOrd for WinHotKeyEvent
impl Eq for WinHotKeyEvent
impl StructuralPartialEq for WinHotKeyEvent
Auto Trait Implementations§
impl Freeze for WinHotKeyEvent
impl RefUnwindSafe for WinHotKeyEvent
impl Send for WinHotKeyEvent
impl Sync for WinHotKeyEvent
impl Unpin for WinHotKeyEvent
impl UnwindSafe for WinHotKeyEvent
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