pub enum AcceleratorKey {
Ctrl,
Alt,
Shift,
Key(VirtualKeyCode),
}
Expand description
Utility function for easier creation of a keymap - i.e. [vec![Ctrl, S], my_function]
Variants§
Implementations§
Source§impl AcceleratorKey
impl AcceleratorKey
Sourcepub fn matches(&self, keyboard_state: &KeyboardState) -> bool
pub fn matches(&self, keyboard_state: &KeyboardState) -> bool
Checks if the current keyboard state contains the given char or modifier,
i.e. if the keyboard state currently has the shift key pressed and the
accelerator key is Shift
, evaluates to true, otherwise to false.
Trait Implementations§
Source§impl Clone for AcceleratorKey
impl Clone for AcceleratorKey
Source§fn clone(&self) -> AcceleratorKey
fn clone(&self) -> AcceleratorKey
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 AcceleratorKey
impl Debug for AcceleratorKey
Source§impl Hash for AcceleratorKey
impl Hash for AcceleratorKey
Source§impl Ord for AcceleratorKey
impl Ord for AcceleratorKey
Source§fn cmp(&self, other: &AcceleratorKey) -> Ordering
fn cmp(&self, other: &AcceleratorKey) -> 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 AcceleratorKey
impl PartialEq for AcceleratorKey
Source§impl PartialOrd for AcceleratorKey
impl PartialOrd for AcceleratorKey
impl Copy for AcceleratorKey
impl Eq for AcceleratorKey
impl StructuralPartialEq for AcceleratorKey
Auto Trait Implementations§
impl Freeze for AcceleratorKey
impl RefUnwindSafe for AcceleratorKey
impl Send for AcceleratorKey
impl Sync for AcceleratorKey
impl Unpin for AcceleratorKey
impl UnwindSafe for AcceleratorKey
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<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§unsafe fn clone_to_uninit(&self, dst: *mut T)
unsafe fn clone_to_uninit(&self, dst: *mut T)
🔬This is a nightly-only experimental API. (
clone_to_uninit
)