pub struct HotkeyManager<T> { /* private fields */ }Expand description
The HotkeyManager is used to register, unregister and await hotkeys with their callback functions.
§Note
Due to limitations with the windows event system the HotkeyManager can’t be moved to other threads.
Implementations§
Source§impl<T> HotkeyManager<T>
impl<T> HotkeyManager<T>
Sourcepub fn set_no_repeat(&mut self, no_repeat: bool)
pub fn set_no_repeat(&mut self, no_repeat: bool)
Enable or disable the automatically applied ModKey::NoRepeat modifier. By default, this
option is set to true which causes all hotkey registration calls to add the NoRepeat
modifier, thereby disabling automatic retriggers of hotkeys when holding down the keys.
When this option is disabled, the ModKey::NoRepeat can still be manually added while
registering hotkeys.
Note: Setting this flag doesn’t change previously registered hotkeys. It only applies to registrations performed after calling this function.
Trait Implementations§
Source§impl<T> Default for HotkeyManager<T>
impl<T> Default for HotkeyManager<T>
Source§impl<T> Drop for HotkeyManager<T>
impl<T> Drop for HotkeyManager<T>
Source§impl<T> HotkeyManagerImpl<T> for HotkeyManager<T>
impl<T> HotkeyManagerImpl<T> for HotkeyManager<T>
Source§fn new() -> HotkeyManager<T>
fn new() -> HotkeyManager<T>
Create a new HotkeyManager instance. This instance can’t be moved to other threads due to limitations in the windows events system.
Source§fn register_extrakeys(
&mut self,
key: VKey,
key_modifiers: &[ModKey],
extra_keys: &[VKey],
callback: impl Fn() -> T + Send + 'static,
) -> Result<HotkeyId, HkError>
fn register_extrakeys( &mut self, key: VKey, key_modifiers: &[ModKey], extra_keys: &[VKey], callback: impl Fn() -> T + Send + 'static, ) -> Result<HotkeyId, HkError>
Source§fn register(
&mut self,
key: VKey,
key_modifiers: &[ModKey],
callback: impl Fn() -> T + Send + 'static,
) -> Result<HotkeyId, HkError>
fn register( &mut self, key: VKey, key_modifiers: &[ModKey], callback: impl Fn() -> T + Send + 'static, ) -> Result<HotkeyId, HkError>
register_extrakeys but without extra keys. Read moreSource§fn unregister(&mut self, id: HotkeyId) -> Result<(), HkError>
fn unregister(&mut self, id: HotkeyId) -> Result<(), HkError>
Source§fn unregister_all(&mut self) -> Result<(), HkError>
fn unregister_all(&mut self) -> Result<(), HkError>
Source§fn handle_hotkey(&self) -> Option<T>
fn handle_hotkey(&self) -> Option<T>
Source§fn event_loop(&self)
fn event_loop(&self)
Source§fn interrupt_handle(&self) -> InterruptHandle
fn interrupt_handle(&self) -> InterruptHandle
InterruptHandle for this HotkeyManager that can be used to interrupt the event
loop.