[][src]Enum keyberon::key_code::KeyCode

#[repr(u8)]pub enum KeyCode {
    No,
    ErrorRollOver,
    PostFail,
    ErrorUndefined,
    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,
    Kb1,
    Kb2,
    Kb3,
    Kb4,
    Kb5,
    Kb6,
    Kb7,
    Kb8,
    Kb9,
    Kb0,
    Enter,
    Escape,
    BSpace,
    Tab,
    Space,
    Minus,
    Equal,
    LBracket,
    RBracket,
    Bslash,
    NonUsHash,
    SColon,
    Quote,
    Grave,
    Comma,
    Dot,
    Slash,
    CapsLock,
    F1,
    F2,
    F3,
    F4,
    F5,
    F6,
    F7,
    F8,
    F9,
    F10,
    F11,
    F12,
    PScreen,
    ScrollLock,
    Pause,
    Insert,
    Home,
    PgUp,
    Delete,
    End,
    PgDown,
    Right,
    Left,
    Down,
    Up,
    NumLock,
    KpSlash,
    KpAsterisk,
    KpMinus,
    KpPlus,
    KpEnter,
    Kp1,
    Kp2,
    Kp3,
    Kp4,
    Kp5,
    Kp6,
    Kp7,
    Kp8,
    Kp9,
    Kp0,
    KpDot,
    NonUsBslash,
    Application,
    Power,
    KpEqual,
    F13,
    F14,
    F15,
    F16,
    F17,
    F18,
    F19,
    F20,
    F21,
    F22,
    F23,
    F24,
    Execute,
    Help,
    Menu,
    Select,
    Stop,
    Again,
    Undo,
    Cut,
    Copy,
    Paste,
    Find,
    Mute,
    VolUp,
    VolDown,
    LockingCapsLock,
    LockingNumLock,
    LockingScrollLock,
    KpComma,
    KpEqualSign,
    Intl1,
    Intl2,
    Intl3,
    Intl4,
    Intl5,
    Intl6,
    Intl7,
    Intl8,
    Intl9,
    Lang1,
    Lang2,
    Lang3,
    Lang4,
    Lang5,
    Lang6,
    Lang7,
    Lang8,
    Lang9,
    AltErase,
    SysReq,
    Cancel,
    Clear,
    Prior,
    Return,
    Separator,
    Out,
    Oper,
    ClearAgain,
    CrSel,
    ExSel,
    LCtrl,
    LShift,
    LAlt,
    LGui,
    RCtrl,
    RShift,
    RAlt,
    RGui,
    MediaPlayPause,
    MediaStopCD,
    MediaPreviousSong,
    MediaNextSong,
    MediaEjectCD,
    MediaVolUp,
    MediaVolDown,
    MediaMute,
    MediaWWW,
    MediaBack,
    MediaForward,
    MediaStop,
    MediaFind,
    MediaScrollUp,
    MediaScrollDown,
    MediaEdit,
    MediaSleep,
    MeidaCoffee,
    MediaRefresh,
    MediaCalc,
}

Define a key code according to the HID specification. Their names correspond to the american QWERTY layout.

Variants

No

The "no" key, a placeholder to express nothing.

ErrorRollOver

Error if too much keys are pressed at the same time.

PostFail

The POST fail error.

ErrorUndefined

An undefined error occured.

A

a and 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
Kb1

1 and !.

Kb2

2 and @.

Kb3

3 and #.

Kb4

4 and $.

Kb5

5 and %.

Kb6

6 and ^.

Kb7

7 and &.

Kb8

8 and *.

Kb9

9 and (.

Kb0

0 and ).

Enter
Escape
BSpace
Tab
Space
Minus

- and _.

Equal

= and +.

LBracket

[ and {.

RBracket

] and }.

Bslash

\ and |.

NonUsHash

Non-US # and ~ (Typically near the Enter key).

SColon

; and :.

Quote

' and ".

Grave

` and ~.

Comma

, and <.

Dot

. and >.

Slash

/ and ?.

CapsLock
F1
F2
F3
F4
F5
F6
F7
F8
F9
F10
F11
F12
PScreen
ScrollLock
Pause
Insert
Home
PgUp
Delete
End
PgDown
Right
Left
Down
Up
NumLock
KpSlash

Keypad /

KpAsterisk

Keypad *

KpMinus

Keypad -.

KpPlus

Keypad +.

KpEnter

Keypad enter.

Kp1

Keypad 1.

Kp2
Kp3
Kp4
Kp5
Kp6
Kp7
Kp8
Kp9
Kp0
KpDot
NonUsBslash

Non-US \ and | (Typically near the Left-Shift key)

Application
Power

not a key, used for errors

KpEqual

Keypad =.

F13
F14
F15
F16
F17
F18
F19
F20
F21
F22
F23
F24
Execute
Help
Menu
Select
Stop
Again
Undo
Cut
Copy
Paste
Find
Mute
VolUp
VolDown
LockingCapsLock

Deprecated.

LockingNumLock

Deprecated.

LockingScrollLock

Deprecated.

KpComma

Keypad ,, also used for the brazilian keypad period (.) key.

KpEqualSign

Used on AS/400 keyboard

Intl1
Intl2
Intl3
Intl4
Intl5
Intl6
Intl7
Intl8
Intl9
Lang1
Lang2
Lang3
Lang4
Lang5
Lang6
Lang7
Lang8
Lang9
AltErase
SysReq
Cancel
Clear
Prior
Return
Separator
Out
Oper
ClearAgain
CrSel
ExSel
LCtrl

Left Control.

LShift

Left Shift.

LAlt

Left Alt.

LGui

Left GUI (the Windows key).

RCtrl

Right Control.

RShift

Right Shift.

RAlt

Right Alt (or Alt Gr).

RGui

Right GUI (the Windows key).

MediaPlayPause
MediaStopCD
MediaPreviousSong
MediaNextSong
MediaEjectCD
MediaVolUp
MediaVolDown
MediaMute
MediaWWW
MediaBack
MediaForward
MediaStop
MediaFind
MediaScrollUp
MediaScrollDown
MediaEdit
MediaSleep
MeidaCoffee
MediaRefresh
MediaCalc

Implementations

impl KeyCode[src]

pub fn is_modifier(self) -> bool[src]

Returns true if the key code correspond to a modifier (send separately on USB HID report).

pub fn as_modifier_bit(self) -> u8[src]

Returns the byte with the bit corresponding to the USB HID modifier bitfield setted.

Trait Implementations

impl Clone for KeyCode[src]

impl Copy for KeyCode[src]

impl Debug for KeyCode[src]

impl Eq for KeyCode[src]

impl FromIterator<KeyCode> for KbHidReport[src]

impl Ord for KeyCode[src]

impl PartialEq<KeyCode> for KeyCode[src]

impl PartialOrd<KeyCode> for KeyCode[src]

impl StructuralEq for KeyCode[src]

impl StructuralPartialEq for KeyCode[src]

Auto Trait Implementations

impl Send for KeyCode

impl Sync for KeyCode

impl Unpin for KeyCode

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.