pub enum NamedKey {
Show 15 variants
Enter,
Backspace,
Delete,
ArrowLeft,
ArrowRight,
ArrowUp,
ArrowDown,
Home,
End,
Escape,
Tab,
Copy,
Cut,
Paste,
Insert,
}Expand description
A named (non-character) key: the control keys an editable widget reacts to.
Character-producing keys arrive as Key::Character (already resolved to the
typed text, so dead keys / smart quotes / IME are handled upstream); only the
keys with editing semantics are enumerated here.
Variants§
Enter
Return / Enter — submit or newline.
Backspace
Backspace — delete the grapheme before the caret.
Delete
Forward delete — delete the grapheme after the caret.
ArrowLeft
Move / extend the caret left.
ArrowRight
Move / extend the caret right.
ArrowUp
Move / extend the caret up.
ArrowDown
Move / extend the caret down.
Home
Move to line / document start.
End
Move to line / document end.
Escape
Cancel / dismiss (blur, drop composition).
Tab
Tab — focus traversal or literal tab (widget’s choice).
Copy
The dedicated hardware Copy key (winit’s NamedKey::Copy), present on
full-size and multimedia keyboards. Semantically identical to the
platform copy chord, but it arrives as a key rather than as a modifier
combination, so a shell maps it straight onto
EditCommand::Copy instead of asking a widget to decode a chord.
Cut
The dedicated hardware Cut key (winit’s NamedKey::Cut) — the
Copy note applies verbatim, mapping onto
EditCommand::Cut.
Paste
The dedicated hardware Paste key (winit’s NamedKey::Paste) — the
Copy note applies verbatim. A shell answers it the way
it answers any paste: by reading the host clipboard and dispatching
EditCommand::Paste with the text.
Insert
Insert — carried for the legacy clipboard chords rather than for an
overtype mode: Shift+Insert is paste and Ctrl+Insert is copy on
Windows, Linux, and most X11 terminals, which is the only reason this key
is enumerated here (nothing in this workspace toggles overtype).
Trait Implementations§
impl Copy for NamedKey
impl Eq for NamedKey
impl StructuralPartialEq for NamedKey
Auto Trait Implementations§
impl Freeze for NamedKey
impl RefUnwindSafe for NamedKey
impl Send for NamedKey
impl Sync for NamedKey
impl Unpin for NamedKey
impl UnsafeUnpin for NamedKey
impl UnwindSafe for NamedKey
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
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§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.