pub enum Keyboard {
Show 113 variants
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,
Number0,
Number1,
Number2,
Number3,
Number4,
Number5,
Number6,
Number7,
Number8,
Number9,
LeftAlt,
RightAlt,
LeftShift,
RightShift,
LeftControl,
RightControl,
BackSpace,
Tab,
Enter,
Escape,
Space,
PageUp,
PageDown,
Home,
Left,
Up,
Right,
Down,
Print,
PrintScreen,
Insert,
Delete,
LeftWindows,
RightWindows,
Comma,
Period,
Slash,
SemiColon,
Apostrophe,
LeftBrace,
BackwardSlash,
RightBrace,
Grave,
F1,
F2,
F3,
F4,
F5,
F6,
F7,
F8,
F9,
F10,
F11,
F12,
F13,
F14,
F15,
F16,
F17,
F18,
F19,
F20,
F21,
F22,
F23,
F24,
NumLock,
ScrollLock,
CapsLock,
Numpad0,
Numpad1,
Numpad2,
Numpad3,
Numpad4,
Numpad5,
Numpad6,
Numpad7,
Numpad8,
Numpad9,
Multiply,
Add,
Separator,
Subtract,
Decimal,
Divide,
Other(i32),
}
Variants
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
Number0
Number1
Number2
Number3
Number4
Number5
Number6
Number7
Number8
Number9
LeftAlt
RightAlt
LeftShift
RightShift
LeftControl
RightControl
BackSpace
Tab
Enter
Escape
Space
PageUp
PageDown
Home
Left
Up
Right
Down
Print
PrintScreen
Insert
Delete
LeftWindows
RightWindows
Comma
Period
Slash
SemiColon
Apostrophe
LeftBrace
BackwardSlash
RightBrace
Grave
F1
F2
F3
F4
F5
F6
F7
F8
F9
F10
F11
F12
F13
F14
F15
F16
F17
F18
F19
F20
F21
F22
F23
F24
NumLock
ScrollLock
CapsLock
Numpad0
Numpad1
Numpad2
Numpad3
Numpad4
Numpad5
Numpad6
Numpad7
Numpad8
Numpad9
Multiply
Add
Separator
Subtract
Decimal
Divide
Other(i32)
Implementations
sourceimpl Keyboard
impl Keyboard
sourcepub fn is_toggled(&self) -> bool
pub fn is_toggled(&self) -> bool
Whether this KeyboardKey is toggled, applies for some buttons such as Caps Lock
sourcepub fn bind(&self, handler: impl Fn(Keyboard) + Send + Sync + 'static)
pub fn bind(&self, handler: impl Fn(Keyboard) + Send + Sync + 'static)
Bind an action on this KeyboardKey, action will be invoked on a new thread.
sourcepub fn clear_bind(&self)
pub fn clear_bind(&self)
opposite to bind
. Clears bind
sourcepub fn act_on(&self, action: Action)
pub fn act_on(&self, action: Action)
Binds an action on this KeyboardKey, a version of bind
that can do more.
sourcepub fn is_pressed(&self) -> bool
pub fn is_pressed(&self) -> bool
Whether given KeyboardKey is pressed.
Trait Implementations
sourceimpl<'de> Deserialize<'de> for Keyboard
impl<'de> Deserialize<'de> for Keyboard
sourcefn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
sourceimpl Ord for Keyboard
impl Ord for Keyboard
1.21.0 · sourcefn 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
1.21.0 · sourcefn min(self, other: Self) -> Selfwhere
Self: Sized,
fn min(self, other: Self) -> Selfwhere
Self: Sized,
Compares and returns the minimum of two values. Read more
1.50.0 · sourcefn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
fn clamp(self, min: Self, max: Self) -> Selfwhere
Self: Sized + PartialOrd<Self>,
Restrict a value to a certain interval. Read more
sourceimpl PartialOrd<Keyboard> for Keyboard
impl PartialOrd<Keyboard> for Keyboard
sourcefn partial_cmp(&self, other: &Keyboard) -> Option<Ordering>
fn partial_cmp(&self, other: &Keyboard) -> Option<Ordering>
1.0.0 · sourcefn le(&self, other: &Rhs) -> bool
fn le(&self, other: &Rhs) -> bool
This method tests less than or equal to (for
self
and other
) and is used by the <=
operator. Read moreimpl Copy for Keyboard
impl Eq for Keyboard
impl StructuralEq for Keyboard
impl StructuralPartialEq for Keyboard
Auto Trait Implementations
impl RefUnwindSafe for Keyboard
impl Send for Keyboard
impl Sync for Keyboard
impl Unpin for Keyboard
impl UnwindSafe for Keyboard
Blanket Implementations
sourceimpl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
sourceimpl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.