pub enum LogicalKey {
Named(NamedKey),
Character(String),
Unidentified,
}Expand description
The logical key — the key’s current meaning, layout- and
modifier-dependent, mirroring the W3C UI Events
KeyboardEvent.key attribute.
This is the right facet for activation, navigation, and accelerators
that should follow the printed legend (Ctrl+S wherever S is).
Committed text (IME / dead-key composition) is not carried here —
it arrives as a separate UiEventKind::TextInput event with the
string on UiEvent::text. So this enum stays the meaning of the
key, never the produced text. For layout-independent identity (games,
rebindable hotkeys, numpad disambiguation) use KeyPress::physical.
Variants§
Named(NamedKey)
A named (non-character-producing) key — Enter, ArrowUp, F5.
Character(String)
A character-producing key, carrying the logical character(s) it
stands for (e.g. "a", "A", "ä"). Hotkey matching compares
ASCII case-insensitively, so Character("f") and Character("F")
match the same chord. This is the key’s meaning, not the text it
commits — typed text flows through UiEventKind::TextInput.
Unidentified
The host could not identify the key (dead keys mid-composition,
platform keys with no W3C name). Replaces the old Debug-string
fallback — never a stringly host-formatted value.
Implementations§
Source§impl LogicalKey
impl LogicalKey
Trait Implementations§
Source§impl Clone for LogicalKey
impl Clone for LogicalKey
Source§fn clone(&self) -> LogicalKey
fn clone(&self) -> LogicalKey
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for LogicalKey
impl Debug for LogicalKey
impl Eq for LogicalKey
Source§impl PartialEq for LogicalKey
impl PartialEq for LogicalKey
impl StructuralPartialEq for LogicalKey
Auto Trait Implementations§
impl Freeze for LogicalKey
impl RefUnwindSafe for LogicalKey
impl Send for LogicalKey
impl Sync for LogicalKey
impl Unpin for LogicalKey
impl UnsafeUnpin for LogicalKey
impl UnwindSafe for LogicalKey
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.impl<T> Read<Exclusive, BecauseExclusive> for Twhere
T: ?Sized,
impl<T> Scalar for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
self from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
self is actually part of its subset T (and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
self.to_subset but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
self to the equivalent element of its superset.