pub enum Key {
Show 145 variants
ArrowDown,
ArrowLeft,
ArrowRight,
ArrowUp,
Escape,
Tab,
Backspace,
Enter,
Space,
Insert,
Delete,
Home,
End,
PageUp,
PageDown,
Copy,
Cut,
Paste,
Colon,
Comma,
Backslash,
Slash,
Pipe,
Questionmark,
Exclamationmark,
OpenBracket,
CloseBracket,
OpenCurlyBracket,
CloseCurlyBracket,
Backtick,
Minus,
Period,
Plus,
Equals,
Semicolon,
Quote,
Num0,
Num1,
Num2,
Num3,
Num4,
Num5,
Num6,
Num7,
Num8,
Num9,
A,
B,
C,
D,
E,
F,
G,
H,
I,
J,
K,
L,
M,
N,
O,
P,
Q,
R,
S,
T,
U,
V,
W,
X,
Y,
Z,
F1,
F2,
F3,
F4,
F5,
F6,
F7,
F8,
F9,
F10,
F11,
F12,
F13,
F14,
F15,
F16,
F17,
F18,
F19,
F20,
F21,
F22,
F23,
F24,
F25,
F26,
F27,
F28,
F29,
F30,
F31,
F32,
F33,
F34,
F35,
BrowserBack,
BrowserForward,
BrowserRefresh,
BrowserSearch,
BrowserHome,
BrowserFavorites,
BrowserStop,
MediaPlayPause,
MediaTrackNext,
MediaTrackPrevious,
MediaStop,
AudioVolumeMute,
AudioVolumeDown,
AudioVolumeUp,
LaunchMail,
LaunchApp1,
LaunchApp2,
ShiftLeft,
ShiftRight,
ControlLeft,
ControlRight,
AltLeft,
AltRight,
SuperLeft,
SuperRight,
IntlBackslash,
CapsLock,
NumLock,
ScrollLock,
PrintScreen,
Pause,
Menu,
Fn,
Eject,
Help,
Power,
Sleep,
Clear,
}Expand description
Keyboard keys.
egui usually uses logical keys, i.e. after applying any user keymap.\
Variants§
ArrowDown
ArrowLeft
ArrowRight
ArrowUp
Escape
Tab
Backspace
Enter
Space
Insert
Delete
Home
End
PageUp
PageDown
Copy
Cut
Paste
Colon
:
Comma
,
Backslash
\
Slash
/
Pipe
|, a vertical bar
Questionmark
?
Exclamationmark
OpenBracket
CloseBracket
OpenCurlyBracket
CloseCurlyBracket
Backtick
Also known as “backquote” or “grave”
Minus
-
Period
.
Plus
+
Equals
=
Semicolon
;
Quote
'
Num0
0 (from main row or numpad)
Num1
1 (from main row or numpad)
Num2
2 (from main row or numpad)
Num3
3 (from main row or numpad)
Num4
4 (from main row or numpad)
Num5
5 (from main row or numpad)
Num6
6 (from main row or numpad)
Num7
7 (from main row or numpad)
Num8
8 (from main row or numpad)
Num9
9 (from main row or numpad)
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
F1
F2
F3
F4
F5
F6
F7
F8
F9
F10
F11
F12
F13
F14
F15
F16
F17
F18
F19
F20
F21
F22
F23
F24
F25
F26
F27
F28
F29
F30
F31
F32
F33
F34
F35
BrowserBack
Back navigation key from multimedia keyboard. Android sends this key on Back button press. Does not work on Web.
BrowserForward
Forward navigation key.
BrowserRefresh
Refresh / reload page key.
BrowserSearch
Search key.
BrowserHome
Go to home page key.
BrowserFavorites
Open favorites / bookmarks key.
BrowserStop
Stop loading key.
MediaPlayPause
Play / Pause toggle key.
MediaTrackNext
Next track key.
MediaTrackPrevious
Previous track key.
MediaStop
Stop playback key.
AudioVolumeMute
Mute audio toggle key.
AudioVolumeDown
Decrease audio volume key.
AudioVolumeUp
Increase audio volume key.
LaunchMail
Launch mail application key.
LaunchApp1
Launch application 1 (typically “My Computer”) key.
LaunchApp2
Launch application 2 (typically “Calculator”) key.
ShiftLeft
Left Shift key.
ShiftRight
Right Shift key.
ControlLeft
Left Control key.
ControlRight
Right Control key.
AltLeft
Left Alt / Option key.
AltRight
Right Alt / AltGr / Option key.
SuperLeft
Left Super / Meta / Command / Windows key.
SuperRight
Right Super / Meta / Command / Windows key.
IntlBackslash
ISO 102nd key: physically located between the left Shift and Z
on ISO layouts. On French AZERTY it produces <>|; on UK
QWERTY a secondary \ / |. Missing from US ANSI keyboards.
CapsLock
Caps Lock key.
NumLock
Num Lock key.
ScrollLock
Scroll Lock key.
PrintScreen
Print Screen / SysRq key.
Pause
Pause / Break key.
Menu
Menu / Apps key (opens context menu).
Fn
Fn / Globe key (Mac keyboard function key).
Eject
Eject key (⏏) on Mac keyboards.
Help
Help key (found on older PC and Mac keyboards).
Power
Power key (toggles power state).
Sleep
Sleep / Standby key.
Clear
Clear key (on some keyboards/numpads).
Implementations§
Source§impl Key
impl Key
Sourcepub fn from_name(key: &str) -> Option<Key>
pub fn from_name(key: &str) -> Option<Key>
Converts "A" to Key::A, Space to Key::Space, etc.
Makes sense for logical keys.
This will parse the output of both Self::name and Self::symbol_or_name,
but will also parse single characters, so that both "-" and "Minus" will return Key::Minus.
This should support both the names generated in a web browser,
and by winit. Please test on both with eframe.
Sourcepub fn symbol_or_name(self) -> &'static str
pub fn symbol_or_name(self) -> &'static str
Emoji or name representing the key
Trait Implementations§
impl Copy for Key
impl Eq for Key
Source§impl Ord for Key
impl Ord for Key
1.21.0 (const: unstable) · Source§fn max(self, other: Self) -> Selfwhere
Self: Sized,
fn max(self, other: Self) -> Selfwhere
Self: Sized,
1.21.0 (const: unstable) · Source§fn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Source§impl PartialOrd for Key
impl PartialOrd for Key
impl StructuralPartialEq for Key
Auto Trait Implementations§
impl Forget for Key
impl Freeze for Key
impl Move for Key
impl RefUnwindSafe for Key
impl Send for Key
impl Sync for Key
impl Unpin for Key
impl UnsafeUnpin for Key
impl UnwindSafe for Key
Blanket Implementations§
impl<T> AsId for T
impl<T> AsIdSalt for T
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§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
fn instrument(self, span: Span) -> Instrumented<Self> ⓘ
Source§fn in_current_span(self) -> Instrumented<Self> ⓘ
fn in_current_span(self) -> Instrumented<Self> ⓘ
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
fn into_either(self, into_left: bool) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self> ⓘ
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more