Skip to main content

Key

Enum Key 

Source
#[non_exhaustive]
#[repr(u32)]
pub enum Key {
Show 145 variants Tab = 512, LeftArrow = 513, RightArrow = 514, UpArrow = 515, DownArrow = 516, PageUp = 517, PageDown = 518, Home = 519, End = 520, Insert = 521, Delete = 522, Backspace = 523, Space = 524, Enter = 525, Escape = 526, LeftCtrl = 527, LeftShift = 528, LeftAlt = 529, LeftSuper = 530, RightCtrl = 531, RightShift = 532, RightAlt = 533, RightSuper = 534, Menu = 535, Alpha0 = 536, Alpha1 = 537, Alpha2 = 538, Alpha3 = 539, Alpha4 = 540, Alpha5 = 541, Alpha6 = 542, Alpha7 = 543, Alpha8 = 544, Alpha9 = 545, A = 546, B = 547, C = 548, D = 549, E = 550, F = 551, G = 552, H = 553, I = 554, J = 555, K = 556, L = 557, M = 558, N = 559, O = 560, P = 561, Q = 562, R = 563, S = 564, T = 565, U = 566, V = 567, W = 568, X = 569, Y = 570, Z = 571, F1 = 572, F2 = 573, F3 = 574, F4 = 575, F5 = 576, F6 = 577, F7 = 578, F8 = 579, F9 = 580, F10 = 581, F11 = 582, F12 = 583, Apostrophe = 584, Comma = 585, Minus = 586, Period = 587, Slash = 588, Semicolon = 589, Equal = 590, LeftBracket = 591, Backslash = 592, RightBracket = 593, GraveAccent = 594, CapsLock = 595, ScrollLock = 596, NumLock = 597, PrintScreen = 598, Pause = 599, Keypad0 = 600, Keypad1 = 601, Keypad2 = 602, Keypad3 = 603, Keypad4 = 604, Keypad5 = 605, Keypad6 = 606, Keypad7 = 607, Keypad8 = 608, Keypad9 = 609, KeypadDecimal = 610, KeypadDivide = 611, KeypadMultiply = 612, KeypadSubtract = 613, KeypadAdd = 614, KeypadEnter = 615, KeypadEqual = 616, GamepadStart = 617, GamepadBack = 618, GamepadFaceLeft = 619, GamepadFaceRight = 620, GamepadFaceUp = 621, GamepadFaceDown = 622, GamepadDpadLeft = 623, GamepadDpadRight = 624, GamepadDpadUp = 625, GamepadDpadDown = 626, GamepadL1 = 627, GamepadR1 = 628, GamepadL2 = 629, GamepadR2 = 630, GamepadL3 = 631, GamepadR3 = 632, GamepadLStickLeft = 633, GamepadLStickRight = 634, GamepadLStickUp = 635, GamepadLStickDown = 636, GamepadRStickLeft = 637, GamepadRStickRight = 638, GamepadRStickUp = 639, GamepadRStickDown = 640, MouseLeft = 641, MouseRight = 642, MouseMiddle = 643, MouseX1 = 644, MouseX2 = 645, MouseWheelX = 646, MouseWheelY = 647, ReservedForModCtrl = 648, ReservedForModShift = 649, ReservedForModAlt = 650, ReservedForModSuper = 651, ModCtrl = 4_096, ModShift = 8_192, ModAlt = 16_384, ModSuper = 32_768, ModShortcut = 2_048,
}
Expand description

A key identifier

Variants (Non-exhaustive)§

This enum is marked as non-exhaustive
Non-exhaustive enums could have additional variants added in future. Therefore, when matching against variants of non-exhaustive enums, an extra wildcard arm must be added to account for any future variants.
§

Tab = 512

§

LeftArrow = 513

§

RightArrow = 514

§

UpArrow = 515

§

DownArrow = 516

§

PageUp = 517

§

PageDown = 518

§

Home = 519

§

End = 520

§

Insert = 521

§

Delete = 522

§

Backspace = 523

§

Space = 524

§

Enter = 525

§

Escape = 526

§

LeftCtrl = 527

§

LeftShift = 528

§

LeftAlt = 529

§

LeftSuper = 530

§

RightCtrl = 531

§

RightShift = 532

§

RightAlt = 533

§

RightSuper = 534

§

Menu = 535

§

Alpha0 = 536

§

Alpha1 = 537

§

Alpha2 = 538

§

Alpha3 = 539

§

Alpha4 = 540

§

Alpha5 = 541

§

Alpha6 = 542

§

Alpha7 = 543

§

Alpha8 = 544

§

Alpha9 = 545

§

A = 546

§

B = 547

§

C = 548

§

D = 549

§

E = 550

§

F = 551

§

G = 552

§

H = 553

§

I = 554

§

J = 555

§

K = 556

§

L = 557

§

M = 558

§

N = 559

§

O = 560

§

P = 561

§

Q = 562

§

R = 563

§

S = 564

§

T = 565

§

U = 566

§

V = 567

§

W = 568

§

X = 569

§

Y = 570

§

Z = 571

§

F1 = 572

§

F2 = 573

§

F3 = 574

§

F4 = 575

§

F5 = 576

§

F6 = 577

§

F7 = 578

§

F8 = 579

§

F9 = 580

§

F10 = 581

§

F11 = 582

§

F12 = 583

§

Apostrophe = 584

§

Comma = 585

§

Minus = 586

§

Period = 587

§

Slash = 588

§

Semicolon = 589

§

Equal = 590

§

LeftBracket = 591

§

Backslash = 592

§

RightBracket = 593

§

GraveAccent = 594

§

CapsLock = 595

§

ScrollLock = 596

§

NumLock = 597

§

PrintScreen = 598

§

Pause = 599

§

Keypad0 = 600

§

Keypad1 = 601

§

Keypad2 = 602

§

Keypad3 = 603

§

Keypad4 = 604

§

Keypad5 = 605

§

Keypad6 = 606

§

Keypad7 = 607

§

Keypad8 = 608

§

Keypad9 = 609

§

KeypadDecimal = 610

§

KeypadDivide = 611

§

KeypadMultiply = 612

§

KeypadSubtract = 613

§

KeypadAdd = 614

§

KeypadEnter = 615

§

KeypadEqual = 616

§

GamepadStart = 617

§

GamepadBack = 618

§

GamepadFaceLeft = 619

§

GamepadFaceRight = 620

§

GamepadFaceUp = 621

§

GamepadFaceDown = 622

§

GamepadDpadLeft = 623

§

GamepadDpadRight = 624

§

GamepadDpadUp = 625

§

GamepadDpadDown = 626

§

GamepadL1 = 627

§

GamepadR1 = 628

§

GamepadL2 = 629

§

GamepadR2 = 630

§

GamepadL3 = 631

§

GamepadR3 = 632

§

GamepadLStickLeft = 633

§

GamepadLStickRight = 634

§

GamepadLStickUp = 635

§

GamepadLStickDown = 636

§

GamepadRStickLeft = 637

§

GamepadRStickRight = 638

§

GamepadRStickUp = 639

§

GamepadRStickDown = 640

§

MouseLeft = 641

§

MouseRight = 642

§

MouseMiddle = 643

§

MouseX1 = 644

§

MouseX2 = 645

§

MouseWheelX = 646

§

MouseWheelY = 647

§

ReservedForModCtrl = 648

§

ReservedForModShift = 649

§

ReservedForModAlt = 650

§

ReservedForModSuper = 651

§

ModCtrl = 4_096

§

ModShift = 8_192

§

ModAlt = 16_384

§

ModSuper = 32_768

§

ModShortcut = 2_048

Implementations§

Source§

impl Key

Source

pub const VARIANTS: [Key; 140]

All possible Key variants

Source

pub const COUNT: usize

Total count of Key variants

Trait Implementations§

Source§

impl Clone for Key

Source§

fn clone(&self) -> Key

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

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

Performs copy-assignment from source. Read more
Source§

impl Copy for Key

Source§

impl Debug for Key

Source§

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

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

impl Eq for Key

Source§

impl Hash for Key

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 Index<Key> for Io

Source§

type Output = u32

The returned type after indexing.
Source§

fn index(&self, index: Key) -> &u32

Performs the indexing (container[index]) operation. Read more
Source§

impl IndexMut<Key> for Io

Source§

fn index_mut(&mut self, index: Key) -> &mut u32

Performs the mutable indexing (container[index]) operation. Read more
Source§

impl PartialEq for Key

Source§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 (const: unstable) · 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 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> 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, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. 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.