pub struct ShortcutEvent {
pub id: u32,
pub state: HotKeyState,
}
Expand description
Describes a global hotkey event emitted when a HotKey
is pressed or released.
Fields§
§id: u32
Id of the associated HotKey
.
state: HotKeyState
State of the associated HotKey
.
Implementations§
source§impl GlobalHotKeyEvent
impl GlobalHotKeyEvent
sourcepub fn state(&self) -> HotKeyState
pub fn state(&self) -> HotKeyState
Returns the state of the associated HotKey
.
sourcepub fn receiver<'a>() -> &'a Receiver<GlobalHotKeyEvent>
pub fn receiver<'a>() -> &'a Receiver<GlobalHotKeyEvent>
Gets a reference to the event channel’s GlobalHotKeyEventReceiver
which can be used to listen for global hotkey events.
§Note
This will not receive any events if GlobalHotKeyEvent::set_event_handler
has been called with a Some
value.
sourcepub fn set_event_handler<F>(f: Option<F>)
pub fn set_event_handler<F>(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 GlobalHotKeyEvent::receiver
Trait Implementations§
source§impl Clone for GlobalHotKeyEvent
impl Clone for GlobalHotKeyEvent
source§fn clone(&self) -> GlobalHotKeyEvent
fn clone(&self) -> GlobalHotKeyEvent
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 GlobalHotKeyEvent
impl Debug for GlobalHotKeyEvent
source§impl<'de> Deserialize<'de> for GlobalHotKeyEvent
impl<'de> Deserialize<'de> for GlobalHotKeyEvent
source§fn deserialize<__D>(
__deserializer: __D
) -> Result<GlobalHotKeyEvent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(
__deserializer: __D
) -> Result<GlobalHotKeyEvent, <__D as Deserializer<'de>>::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
source§impl Ord for GlobalHotKeyEvent
impl Ord for GlobalHotKeyEvent
source§fn cmp(&self, other: &GlobalHotKeyEvent) -> Ordering
fn cmp(&self, other: &GlobalHotKeyEvent) -> 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 GlobalHotKeyEvent
impl PartialEq for GlobalHotKeyEvent
source§fn eq(&self, other: &GlobalHotKeyEvent) -> bool
fn eq(&self, other: &GlobalHotKeyEvent) -> bool
This method tests for
self
and other
values to be equal, and is used
by ==
.source§impl PartialOrd for GlobalHotKeyEvent
impl PartialOrd for GlobalHotKeyEvent
source§fn partial_cmp(&self, other: &GlobalHotKeyEvent) -> Option<Ordering>
fn partial_cmp(&self, other: &GlobalHotKeyEvent) -> Option<Ordering>
1.0.0 · source§fn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moresource§impl Serialize for GlobalHotKeyEvent
impl Serialize for GlobalHotKeyEvent
source§fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
fn serialize<__S>(
&self,
__serializer: __S
) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>where
__S: Serializer,
Serialize this value into the given Serde serializer. Read more
impl Copy for GlobalHotKeyEvent
impl Eq for GlobalHotKeyEvent
impl StructuralPartialEq for GlobalHotKeyEvent
Auto Trait Implementations§
impl Freeze for GlobalHotKeyEvent
impl RefUnwindSafe for GlobalHotKeyEvent
impl Send for GlobalHotKeyEvent
impl Sync for GlobalHotKeyEvent
impl Unpin for GlobalHotKeyEvent
impl UnwindSafe for GlobalHotKeyEvent
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
source§impl<'de, D, R> CommandArg<'de, R> for Dwhere
D: Deserialize<'de>,
R: Runtime,
impl<'de, D, R> CommandArg<'de, R> for Dwhere
D: Deserialize<'de>,
R: Runtime,
source§fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>
fn from_command(command: CommandItem<'de, R>) -> Result<D, InvokeError>
source§impl<Q, K> Comparable<K> for Q
impl<Q, K> Comparable<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.