Enum glfw::Key

source ·
#[repr(i32)]
pub enum Key {
Show 121 variants Space = 32, Apostrophe = 39, Comma = 44, Minus = 45, Period = 46, Slash = 47, Num0 = 48, Num1 = 49, Num2 = 50, Num3 = 51, Num4 = 52, Num5 = 53, Num6 = 54, Num7 = 55, Num8 = 56, Num9 = 57, Semicolon = 59, Equal = 61, A = 65, B = 66, C = 67, D = 68, E = 69, F = 70, G = 71, H = 72, I = 73, J = 74, K = 75, L = 76, M = 77, N = 78, O = 79, P = 80, Q = 81, R = 82, S = 83, T = 84, U = 85, V = 86, W = 87, X = 88, Y = 89, Z = 90, LeftBracket = 91, Backslash = 92, RightBracket = 93, GraveAccent = 96, World1 = 161, World2 = 162, Escape = 256, Enter = 257, Tab = 258, Backspace = 259, Insert = 260, Delete = 261, Right = 262, Left = 263, Down = 264, Up = 265, PageUp = 266, PageDown = 267, Home = 268, End = 269, CapsLock = 280, ScrollLock = 281, NumLock = 282, PrintScreen = 283, Pause = 284, F1 = 290, F2 = 291, F3 = 292, F4 = 293, F5 = 294, F6 = 295, F7 = 296, F8 = 297, F9 = 298, F10 = 299, F11 = 300, F12 = 301, F13 = 302, F14 = 303, F15 = 304, F16 = 305, F17 = 306, F18 = 307, F19 = 308, F20 = 309, F21 = 310, F22 = 311, F23 = 312, F24 = 313, F25 = 314, Kp0 = 320, Kp1 = 321, Kp2 = 322, Kp3 = 323, Kp4 = 324, Kp5 = 325, Kp6 = 326, Kp7 = 327, Kp8 = 328, Kp9 = 329, KpDecimal = 330, KpDivide = 331, KpMultiply = 332, KpSubtract = 333, KpAdd = 334, KpEnter = 335, KpEqual = 336, LeftShift = 340, LeftControl = 341, LeftAlt = 342, LeftSuper = 343, RightShift = 344, RightControl = 345, RightAlt = 346, RightSuper = 347, Menu = 348, Unknown = -1,
}
Expand description

Input keys.

Variants§

§

Space = 32

§

Apostrophe = 39

§

Comma = 44

§

Minus = 45

§

Period = 46

§

Slash = 47

§

Num0 = 48

§

Num1 = 49

§

Num2 = 50

§

Num3 = 51

§

Num4 = 52

§

Num5 = 53

§

Num6 = 54

§

Num7 = 55

§

Num8 = 56

§

Num9 = 57

§

Semicolon = 59

§

Equal = 61

§

A = 65

§

B = 66

§

C = 67

§

D = 68

§

E = 69

§

F = 70

§

G = 71

§

H = 72

§

I = 73

§

J = 74

§

K = 75

§

L = 76

§

M = 77

§

N = 78

§

O = 79

§

P = 80

§

Q = 81

§

R = 82

§

S = 83

§

T = 84

§

U = 85

§

V = 86

§

W = 87

§

X = 88

§

Y = 89

§

Z = 90

§

LeftBracket = 91

§

Backslash = 92

§

RightBracket = 93

§

GraveAccent = 96

§

World1 = 161

§

World2 = 162

§

Escape = 256

§

Enter = 257

§

Tab = 258

§

Backspace = 259

§

Insert = 260

§

Delete = 261

§

Right = 262

§

Left = 263

§

Down = 264

§

Up = 265

§

PageUp = 266

§

PageDown = 267

§

Home = 268

§

End = 269

§

CapsLock = 280

§

ScrollLock = 281

§

NumLock = 282

§

PrintScreen = 283

§

Pause = 284

§

F1 = 290

§

F2 = 291

§

F3 = 292

§

F4 = 293

§

F5 = 294

§

F6 = 295

§

F7 = 296

§

F8 = 297

§

F9 = 298

§

F10 = 299

§

F11 = 300

§

F12 = 301

§

F13 = 302

§

F14 = 303

§

F15 = 304

§

F16 = 305

§

F17 = 306

§

F18 = 307

§

F19 = 308

§

F20 = 309

§

F21 = 310

§

F22 = 311

§

F23 = 312

§

F24 = 313

§

F25 = 314

§

Kp0 = 320

§

Kp1 = 321

§

Kp2 = 322

§

Kp3 = 323

§

Kp4 = 324

§

Kp5 = 325

§

Kp6 = 326

§

Kp7 = 327

§

Kp8 = 328

§

Kp9 = 329

§

KpDecimal = 330

§

KpDivide = 331

§

KpMultiply = 332

§

KpSubtract = 333

§

KpAdd = 334

§

KpEnter = 335

§

KpEqual = 336

§

LeftShift = 340

§

LeftControl = 341

§

LeftAlt = 342

§

LeftSuper = 343

§

RightShift = 344

§

RightControl = 345

§

RightAlt = 346

§

RightSuper = 347

§

Menu = 348

§

Unknown = -1

Implementations§

source§

impl Key

source

pub fn name(&self) -> String

👎Deprecated since 0.16.0: Key method ‘name’ can cause a segfault, use ‘get_name’ instead

Wrapper around glfwGetKeyName without scancode

source

pub fn get_name(&self) -> Option<String>

Wrapper around glfwGetKeyName without scancode

source

pub fn get_scancode(&self) -> Option<Scancode>

Wrapper around glfwGetKeyScancode.

Trait Implementations§

source§

impl Clone for Key

source§

fn clone(&self) -> Key

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 Key

source§

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

Formats the value using the given formatter. Read more
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 Ord for Key

source§

fn cmp(&self, other: &Key) -> 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 + PartialOrd,

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

impl PartialEq for Key

source§

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

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

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

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

impl PartialOrd for Key

source§

fn partial_cmp(&self, other: &Key) -> 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

This method 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

This method 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

This method 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

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

impl Copy for Key

source§

impl Eq for Key

source§

impl StructuralPartialEq for Key

Auto Trait Implementations§

§

impl RefUnwindSafe for Key

§

impl Send for Key

§

impl Sync for Key

§

impl Unpin 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> 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,

§

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>,

§

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>,

§

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.