pub struct Key(pub u8);Expand description
a keyboard key by its HID usage (page 0x07). the consts cover the usual keys, and Key(n) gets you any
other one from 0x04 to 0xE7
Tuple Fields§
§0: u8Implementations§
Source§impl Key
impl Key
pub const A: Key
pub const B: Key
pub const C: Key
pub const D: Key
pub const E: Key
pub const F: Key
pub const G: Key
pub const H: Key
pub const I: Key
pub const J: Key
pub const K: Key
pub const L: Key
pub const M: Key
pub const N: Key
pub const O: Key
pub const P: Key
pub const Q: Key
pub const R: Key
pub const S: Key
pub const T: Key
pub const U: Key
pub const V: Key
pub const W: Key
pub const X: Key
pub const Y: Key
pub const Z: Key
pub const NUM1: Key
pub const NUM2: Key
pub const NUM3: Key
pub const NUM4: Key
pub const NUM5: Key
pub const NUM6: Key
pub const NUM7: Key
pub const NUM8: Key
pub const NUM9: Key
pub const NUM0: Key
pub const ENTER: Key
pub const ESCAPE: Key
pub const BACKSPACE: Key
pub const TAB: Key
pub const SPACE: Key
pub const MINUS: Key
pub const EQUAL: Key
pub const LEFT_BRACKET: Key
pub const RIGHT_BRACKET: Key
pub const BACKSLASH: Key
pub const SEMICOLON: Key
pub const APOSTROPHE: Key
pub const GRAVE: Key
pub const COMMA: Key
pub const PERIOD: Key
pub const SLASH: Key
pub const CAPS_LOCK: Key
pub const F1: Key
pub const F2: Key
pub const F3: Key
pub const F4: Key
pub const F5: Key
pub const F6: Key
pub const F7: Key
pub const F8: Key
pub const F9: Key
pub const F10: Key
pub const F11: Key
pub const F12: Key
pub const PRINT_SCREEN: Key
pub const SCROLL_LOCK: Key
pub const PAUSE: Key
pub const INSERT: Key
pub const HOME: Key
pub const PAGE_UP: Key
pub const DELETE: Key
pub const END: Key
pub const PAGE_DOWN: Key
pub const RIGHT: Key
pub const LEFT: Key
pub const DOWN: Key
pub const UP: Key
pub const NUM_LOCK: Key
pub const KEYPAD_DIVIDE: Key
pub const KEYPAD_MULTIPLY: Key
pub const KEYPAD_MINUS: Key
pub const KEYPAD_PLUS: Key
pub const KEYPAD_ENTER: Key
pub const KEYPAD1: Key
pub const KEYPAD2: Key
pub const KEYPAD3: Key
pub const KEYPAD4: Key
pub const KEYPAD5: Key
pub const KEYPAD6: Key
pub const KEYPAD7: Key
pub const KEYPAD8: Key
pub const KEYPAD9: Key
pub const KEYPAD0: Key
pub const KEYPAD_PERIOD: Key
pub const MENU: Key
pub const LEFT_CTRL: Key
pub const LEFT_SHIFT: Key
pub const LEFT_ALT: Key
pub const LEFT_GUI: Key
pub const RIGHT_CTRL: Key
pub const RIGHT_SHIFT: Key
pub const RIGHT_ALT: Key
pub const RIGHT_GUI: Key
Sourcepub const fn is_modifier(self) -> bool
pub const fn is_modifier(self) -> bool
ctrl, shift, alt and gui on either side. a keyboard report keeps these in a byte of their own
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,
Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§fn 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
Source§impl PartialOrd for Key
impl PartialOrd for Key
impl StructuralPartialEq for Key
Auto Trait Implementations§
impl Freeze 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§
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
Mutably borrows from an owned value. Read more