dreg_core::context

Struct Scancode

source
pub struct Scancode(pub u16);
Expand description

A button’s scancode. Maps directly to the evdev scancodes.

A value of 0 is “reserved” (always invalid).

See https://github.com/emberian/evdev/blob/main/src/scancodes.rs#L26-L572 for reference.

[1]   [59][60][61][62]   [63][64][65][66]   [67][68][87][88]
[41][ 2][ 3][ 4][ 5][ 6][ 7][ 8][ 9][10][11][12][13][  14  ]
[ 15 ][16][17][18][19][20][21][22][23][24][25][26][27][ 43 ]
[  58  ][30][31][32][33][34][35][36][37][38][39][40][  28  ]
[   42   ][44][45][46][47][48][49][50][52][52][53][   54   ]
[29][125][56][           57           ][100][0x1d0][139][97]

Tuple Fields§

§0: u16

Implementations§

source§

impl Scancode

source

pub fn from_char(c: char) -> (Option<Self>, Self)

source§

impl Scancode

source

pub const NULL: Self = _

source

pub const ESC: Self = _

source

pub const K_1: Self = _

source

pub const K_2: Self = _

source

pub const K_3: Self = _

source

pub const K_4: Self = _

source

pub const K_5: Self = _

source

pub const K_6: Self = _

source

pub const K_7: Self = _

source

pub const K_8: Self = _

source

pub const K_9: Self = _

source

pub const K_0: Self = _

source

pub const MINUS: Self = _

source

pub const EQUAL: Self = _

source

pub const BACKSPACE: Self = _

source

pub const TAB: Self = _

source

pub const Q: Self = _

source

pub const W: Self = _

source

pub const E: Self = _

source

pub const R: Self = _

source

pub const T: Self = _

source

pub const Y: Self = _

source

pub const U: Self = _

source

pub const I: Self = _

source

pub const O: Self = _

source

pub const P: Self = _

source

pub const L_BRACE: Self = _

source

pub const R_BRACE: Self = _

source

pub const ENTER: Self = _

source

pub const L_CTRL: Self = _

source

pub const A: Self = _

source

pub const S: Self = _

source

pub const D: Self = _

source

pub const F: Self = _

source

pub const G: Self = _

source

pub const H: Self = _

source

pub const J: Self = _

source

pub const K: Self = _

source

pub const L: Self = _

source

pub const SEMICOLON: Self = _

source

pub const APOSTROPHE: Self = _

source

pub const GRAVE: Self = _

source

pub const L_SHIFT: Self = _

source

pub const BACKSLASH: Self = _

source

pub const Z: Self = _

source

pub const X: Self = _

source

pub const C: Self = _

source

pub const V: Self = _

source

pub const B: Self = _

source

pub const N: Self = _

source

pub const M: Self = _

source

pub const COMMA: Self = _

source

pub const DOT: Self = _

source

pub const SLASH: Self = _

source

pub const R_SHIFT: Self = _

source

pub const KP_ASTERISK: Self = _

source

pub const L_ALT: Self = _

source

pub const SPACE: Self = _

source

pub const CAPSLOCK: Self = _

source

pub const F1: Self = _

source

pub const F2: Self = _

source

pub const F3: Self = _

source

pub const F4: Self = _

source

pub const F5: Self = _

source

pub const F6: Self = _

source

pub const F7: Self = _

source

pub const F8: Self = _

source

pub const F9: Self = _

source

pub const F10: Self = _

source

pub const R_CTRL: Self = _

source

pub const R_ALT: Self = _

source

pub const HOME: Self = _

source

pub const UP: Self = _

source

pub const PAGEUP: Self = _

source

pub const LEFT: Self = _

source

pub const RIGHT: Self = _

source

pub const END: Self = _

source

pub const DOWN: Self = _

source

pub const PAGEDOWN: Self = _

source

pub const INSERT: Self = _

source

pub const DELETE: Self = _

source

pub const SCROLLUP: Self = _

source

pub const SCROLLDOWN: Self = _

source

pub const LMB: Self = _

source

pub const RMB: Self = _

source

pub const MMB: Self = _

Trait Implementations§

source§

impl Clone for Scancode

source§

fn clone(&self) -> Scancode

Returns a copy of the value. Read more
1.0.0 · source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
source§

impl Debug for Scancode

source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
source§

impl From<u16> for Scancode

source§

fn from(value: u16) -> Self

Converts to this type from the input type.
source§

impl Hash for Scancode

source§

fn hash<__H: Hasher>(&self, state: &mut __H)

Feeds this value into the given Hasher. Read more
1.3.0 · source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
source§

impl Ord for Scancode

source§

fn cmp(&self, other: &Scancode) -> Ordering

This method returns an Ordering between self and other. Read more
1.21.0 · source§

fn max(self, other: Self) -> Self
where Self: Sized,

Compares and returns the maximum of two values. Read more
1.21.0 · source§

fn min(self, other: Self) -> Self
where Self: Sized,

Compares and returns the minimum of two values. Read more
1.50.0 · source§

fn clamp(self, min: Self, max: Self) -> Self
where Self: Sized,

Restrict a value to a certain interval. Read more
source§

impl PartialEq for Scancode

source§

fn eq(&self, other: &Scancode) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
source§

impl PartialOrd for Scancode

source§

fn partial_cmp(&self, other: &Scancode) -> Option<Ordering>

This method returns an ordering between self and other values if one exists. Read more
1.0.0 · source§

fn lt(&self, other: &Rhs) -> bool

Tests less than (for self and other) and is used by the < operator. Read more
1.0.0 · source§

fn le(&self, other: &Rhs) -> bool

Tests less than or equal to (for self and other) and is used by the <= operator. Read more
1.0.0 · source§

fn gt(&self, other: &Rhs) -> bool

Tests greater than (for self and other) and is used by the > operator. Read more
1.0.0 · source§

fn ge(&self, other: &Rhs) -> bool

Tests greater than or equal to (for self and other) and is used by the >= operator. Read more
source§

impl Copy for Scancode

source§

impl Eq for Scancode

source§

impl StructuralPartialEq for Scancode

Auto Trait Implementations§

Blanket Implementations§

source§

impl<T> Any for T
where T: 'static + ?Sized,

source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
source§

impl<T> Borrow<T> for T
where T: ?Sized,

source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
source§

impl<T> CloneToUninit for T
where T: Clone,

source§

unsafe fn clone_to_uninit(&self, dst: *mut T)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dst. Read more
source§

impl<T> From<T> for T

source§

fn from(t: T) -> T

Returns the argument unchanged.

source§

impl<T, U> Into<U> for T
where U: From<T>,

source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

source§

impl<T> ToOwned for T
where T: Clone,

source§

type Owned = T

The resulting type after obtaining ownership.
source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

source§

type Error = Infallible

The type returned in the event of a conversion error.
source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

source§

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

The type returned in the event of a conversion error.
source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.