pub struct LogicalKeySet { /* private fields */ }Expand description
A set of LogicalKeyboardKeys that can be used as the keys in a map.
LogicalKeySet can be used as a ShortcutActivator. It is not recommended to use
LogicalKeySet for a common shortcut such as Delete or Ctrl+C, prefer
SingleActivator when possible, whose behavior more closely resembles that of typical
platforms.
When used as a ShortcutActivator, LogicalKeySet will activate the intent when all
keys are pressed, and no others, except that modifier keys are considered
without considering sides (e.g. control left and control right are considered the same).
This is also a thin wrapper around a set, but changes the equality comparison from an identity comparison to a contents comparison so that non-identical sets with the same keys in them will compare as equal.
Implementations§
Source§impl LogicalKeySet
impl LogicalKeySet
Sourcepub fn new(
key1: LogicalKeyboardKey,
key2: Option<LogicalKeyboardKey>,
key3: Option<LogicalKeyboardKey>,
key4: Option<LogicalKeyboardKey>,
) -> LogicalKeySet
pub fn new( key1: LogicalKeyboardKey, key2: Option<LogicalKeyboardKey>, key3: Option<LogicalKeyboardKey>, key4: Option<LogicalKeyboardKey>, ) -> LogicalKeySet
A constructor for making a LogicalKeySet of up to four keys.
If you need a set of more than four keys, use from_set.
The same LogicalKeyboardKey may not appear more than once in the set.
Sourcepub fn from_set(keys: HashSet<LogicalKeyboardKey>) -> LogicalKeySet
pub fn from_set(keys: HashSet<LogicalKeyboardKey>) -> LogicalKeySet
Create a LogicalKeySet from a set of LogicalKeyboardKeys.
Sourcepub fn keys(&self) -> HashSet<LogicalKeyboardKey>
pub fn keys(&self) -> HashSet<LogicalKeyboardKey>
The keys this set was built from.
Trait Implementations§
Source§impl Clone for LogicalKeySet
impl Clone for LogicalKeySet
Source§impl Debug for LogicalKeySet
impl Debug for LogicalKeySet
impl Eq for LogicalKeySet
Source§impl PartialEq for LogicalKeySet
impl PartialEq for LogicalKeySet
Source§impl ShortcutActivator for LogicalKeySet
impl ShortcutActivator for LogicalKeySet
Source§fn debug_fill_properties(&self, properties: &mut DiagnosticPropertiesBuilder)
fn debug_fill_properties(&self, properties: &mut DiagnosticPropertiesBuilder)
ShortcutActivator.debugFillProperties, from Diagnosticable: an activator
adds its own fields.Source§fn triggers(&self) -> Option<Vec<LogicalKeyboardKey>>
fn triggers(&self) -> Option<Vec<LogicalKeyboardKey>>
Source§fn accepts(
&self,
app: &App,
event: &KeyEvent,
state: Handle<HardwareKeyboard>,
) -> bool
fn accepts( &self, app: &App, event: &KeyEvent, state: Handle<HardwareKeyboard>, ) -> bool
event and the keyboard state at the time of the event meet
required conditions, providing that the event is a triggering event. Read moreSource§fn debug_describe_keys(&self) -> String
fn debug_describe_keys(&self) -> String
Source§fn to_string_short(&self) -> String
fn to_string_short(&self) -> String
ShortcutActivator.toStringShort: the type and the identity.Source§fn diagnostic_string(&self) -> String
fn diagnostic_string(&self) -> String
Diagnosticable.toString, which a shortcut map’s entries print.impl StructuralPartialEq for LogicalKeySet
Auto Trait Implementations§
impl Forget for LogicalKeySet
impl Freeze for LogicalKeySet
impl Move for LogicalKeySet
impl RefUnwindSafe for LogicalKeySet
impl Send for LogicalKeySet
impl Sync for LogicalKeySet
impl Unpin for LogicalKeySet
impl UnsafeUnpin for LogicalKeySet
impl UnwindSafe for LogicalKeySet
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
impl<ST, DT> CastableFrom<ST, Initialized, Initialized> for DT
impl<ST, DT> CastableFrom<ST, Uninit, Uninit> for DT
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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
key and return true if they are equal.