[][src]Enum readkey::Keycode

#[repr(u16)]
pub enum Keycode {
    A,
    S,
    D,
    F,
    H,
    G,
    Z,
    X,
    C,
    V,
    B,
    Q,
    W,
    E,
    R,
    Y,
    T,
    _1,
    _2,
    _3,
    _4,
    _6,
    _5,
    Equal,
    _9,
    _7,
    Minus,
    _8,
    _0,
    RightBracket,
    O,
    U,
    LeftBracket,
    I,
    P,
    L,
    J,
    Quote,
    K,
    Semicolon,
    Backslash,
    Comma,
    Slash,
    N,
    M,
    Period,
    Grave,
    KeypadDecimal,
    KeypadMultiply,
    KeypadPlus,
    KeypadClear,
    KeypadDivide,
    KeypadEnter,
    KeypadMinus,
    KeypadEquals,
    Keypad0,
    Keypad1,
    Keypad2,
    Keypad3,
    Keypad4,
    Keypad5,
    Keypad6,
    Keypad7,
    Keypad8,
    Keypad9,
    Return,
    Tab,
    Space,
    Delete,
    Escape,
    Command,
    Shift,
    CapsLock,
    Option,
    Control,
    RightShift,
    RightOption,
    RightControl,
    Function,
    F17,
    VolumeUp,
    VolumeDown,
    Mute,
    F18,
    F19,
    F20,
    F5,
    F6,
    F7,
    F3,
    F8,
    F9,
    F11,
    F13,
    F16,
    F14,
    F10,
    F12,
    F15,
    Help,
    Home,
    PageUp,
    ForwardDelete,
    F4,
    End,
    F2,
    PageDown,
    F1,
    Left,
    Right,
    Down,
    Up,
    Section,
    Yen,
    Underscore,
    KeypadComma,
    Eisu,
    Kana,
}

Carbon's virtual keycodes, found here.

Variants

A
S
D
F
H
G
Z
X
C
V
B
Q
W
E
R
Y
T
_1
_2
_3
_4
_6
_5
Equal
_9
_7
Minus
_8
_0
RightBracket
O
U
LeftBracket
I
P
L
J
Quote
K
Semicolon
Backslash
Comma
Slash
N
M
Period
Grave
KeypadDecimal
KeypadMultiply
KeypadPlus
KeypadClear
KeypadDivide
KeypadEnter
KeypadMinus
KeypadEquals
Keypad0
Keypad1
Keypad2
Keypad3
Keypad4
Keypad5
Keypad6
Keypad7
Keypad8
Keypad9
Return

Keycodes for keys that are independent of keyboard layout

Tab
Space
Delete
Escape
Command
Shift
CapsLock
Option
Control
RightShift
RightOption
RightControl
Function
F17
VolumeUp
VolumeDown
Mute
F18
F19
F20
F5
F6
F7
F3
F8
F9
F11
F13
F16
F14
F10
F12
F15
Help
Home
PageUp
ForwardDelete
F4
End
F2
PageDown
F1
Left
Right
Down
Up
Section

ISO keyboards only

Yen

JIS keyboards only

Underscore
KeypadComma
Eisu
Kana

Methods

impl Keycode[src]

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

Returns true if key is currently pressed.

use readkey::Keycode;
loop {
  println!("State of Up key: {:?}, ", Keycode::Up.is_pressed());
}

Trait Implementations

impl Clone for Keycode[src]

impl Copy for Keycode[src]

Auto Trait Implementations

impl RefUnwindSafe for Keycode

impl Send for Keycode

impl Sync for Keycode

impl Unpin for Keycode

impl UnwindSafe 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> ToOwned for T where
    T: Clone
[src]

type Owned = T

The resulting type after obtaining ownership.

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.