Enum piston_window::prelude::input::Key

source ·
pub enum Key {
Show 236 variants Unknown = 0, Backspace = 8, Tab = 9, Return = 13, Escape = 27, Space = 32, Exclaim = 33, Quotedbl = 34, Hash = 35, Dollar = 36, Percent = 37, Ampersand = 38, Quote = 39, LeftParen = 40, RightParen = 41, Asterisk = 42, Plus = 43, Comma = 44, Minus = 45, Period = 46, Slash = 47, D0 = 48, D1 = 49, D2 = 50, D3 = 51, D4 = 52, D5 = 53, D6 = 54, D7 = 55, D8 = 56, D9 = 57, Colon = 58, Semicolon = 59, Less = 60, Equals = 61, Greater = 62, Question = 63, At = 64, LeftBracket = 91, Backslash = 92, RightBracket = 93, Caret = 94, Underscore = 95, Backquote = 96, A = 97, B = 98, C = 99, D = 100, E = 101, F = 102, G = 103, H = 104, I = 105, J = 106, K = 107, L = 108, M = 109, N = 110, O = 111, P = 112, Q = 113, R = 114, S = 115, T = 116, U = 117, V = 118, W = 119, X = 120, Y = 121, Z = 122, Delete = 127, CapsLock = 1_073_741_881, F1 = 1_073_741_882, F2 = 1_073_741_883, F3 = 1_073_741_884, F4 = 1_073_741_885, F5 = 1_073_741_886, F6 = 1_073_741_887, F7 = 1_073_741_888, F8 = 1_073_741_889, F9 = 1_073_741_890, F10 = 1_073_741_891, F11 = 1_073_741_892, F12 = 1_073_741_893, PrintScreen = 1_073_741_894, ScrollLock = 1_073_741_895, Pause = 1_073_741_896, Insert = 1_073_741_897, Home = 1_073_741_898, PageUp = 1_073_741_899, End = 1_073_741_901, PageDown = 1_073_741_902, Right = 1_073_741_903, Left = 1_073_741_904, Down = 1_073_741_905, Up = 1_073_741_906, NumLockClear = 1_073_741_907, NumPadDivide = 1_073_741_908, NumPadMultiply = 1_073_741_909, NumPadMinus = 1_073_741_910, NumPadPlus = 1_073_741_911, NumPadEnter = 1_073_741_912, NumPad1 = 1_073_741_913, NumPad2 = 1_073_741_914, NumPad3 = 1_073_741_915, NumPad4 = 1_073_741_916, NumPad5 = 1_073_741_917, NumPad6 = 1_073_741_918, NumPad7 = 1_073_741_919, NumPad8 = 1_073_741_920, NumPad9 = 1_073_741_921, NumPad0 = 1_073_741_922, NumPadPeriod = 1_073_741_923, Application = 1_073_741_925, Power = 1_073_741_926, NumPadEquals = 1_073_741_927, F13 = 1_073_741_928, F14 = 1_073_741_929, F15 = 1_073_741_930, F16 = 1_073_741_931, F17 = 1_073_741_932, F18 = 1_073_741_933, F19 = 1_073_741_934, F20 = 1_073_741_935, F21 = 1_073_741_936, F22 = 1_073_741_937, F23 = 1_073_741_938, F24 = 1_073_741_939, Execute = 1_073_741_940, Help = 1_073_741_941, Menu = 1_073_741_942, Select = 1_073_741_943, Stop = 1_073_741_944, Again = 1_073_741_945, Undo = 1_073_741_946, Cut = 1_073_741_947, Copy = 1_073_741_948, Paste = 1_073_741_949, Find = 1_073_741_950, Mute = 1_073_741_951, VolumeUp = 1_073_741_952, VolumeDown = 1_073_741_953, NumPadComma = 1_073_741_957, NumPadEqualsAS400 = 1_073_741_958, AltErase = 1_073_741_977, Sysreq = 1_073_741_978, Cancel = 1_073_741_979, Clear = 1_073_741_980, Prior = 1_073_741_981, Return2 = 1_073_741_982, Separator = 1_073_741_983, Out = 1_073_741_984, Oper = 1_073_741_985, ClearAgain = 1_073_741_986, CrSel = 1_073_741_987, ExSel = 1_073_741_988, NumPad00 = 1_073_742_000, NumPad000 = 1_073_742_001, ThousandsSeparator = 1_073_742_002, DecimalSeparator = 1_073_742_003, CurrencyUnit = 1_073_742_004, CurrencySubUnit = 1_073_742_005, NumPadLeftParen = 1_073_742_006, NumPadRightParen = 1_073_742_007, NumPadLeftBrace = 1_073_742_008, NumPadRightBrace = 1_073_742_009, NumPadTab = 1_073_742_010, NumPadBackspace = 1_073_742_011, NumPadA = 1_073_742_012, NumPadB = 1_073_742_013, NumPadC = 1_073_742_014, NumPadD = 1_073_742_015, NumPadE = 1_073_742_016, NumPadF = 1_073_742_017, NumPadXor = 1_073_742_018, NumPadPower = 1_073_742_019, NumPadPercent = 1_073_742_020, NumPadLess = 1_073_742_021, NumPadGreater = 1_073_742_022, NumPadAmpersand = 1_073_742_023, NumPadDblAmpersand = 1_073_742_024, NumPadVerticalBar = 1_073_742_025, NumPadDblVerticalBar = 1_073_742_026, NumPadColon = 1_073_742_027, NumPadHash = 1_073_742_028, NumPadSpace = 1_073_742_029, NumPadAt = 1_073_742_030, NumPadExclam = 1_073_742_031, NumPadMemStore = 1_073_742_032, NumPadMemRecall = 1_073_742_033, NumPadMemClear = 1_073_742_034, NumPadMemAdd = 1_073_742_035, NumPadMemSubtract = 1_073_742_036, NumPadMemMultiply = 1_073_742_037, NumPadMemDivide = 1_073_742_038, NumPadPlusMinus = 1_073_742_039, NumPadClear = 1_073_742_040, NumPadClearEntry = 1_073_742_041, NumPadBinary = 1_073_742_042, NumPadOctal = 1_073_742_043, NumPadDecimal = 1_073_742_044, NumPadHexadecimal = 1_073_742_045, LCtrl = 1_073_742_048, LShift = 1_073_742_049, LAlt = 1_073_742_050, LGui = 1_073_742_051, RCtrl = 1_073_742_052, RShift = 1_073_742_053, RAlt = 1_073_742_054, RGui = 1_073_742_055, Mode = 1_073_742_081, AudioNext = 1_073_742_082, AudioPrev = 1_073_742_083, AudioStop = 1_073_742_084, AudioPlay = 1_073_742_085, AudioMute = 1_073_742_086, MediaSelect = 1_073_742_087, Www = 1_073_742_088, Mail = 1_073_742_089, Calculator = 1_073_742_090, Computer = 1_073_742_091, AcSearch = 1_073_742_092, AcHome = 1_073_742_093, AcBack = 1_073_742_094, AcForward = 1_073_742_095, AcStop = 1_073_742_096, AcRefresh = 1_073_742_097, AcBookmarks = 1_073_742_098, BrightnessDown = 1_073_742_099, BrightnessUp = 1_073_742_100, DisplaySwitch = 1_073_742_101, KbdIllumToggle = 1_073_742_102, KbdIllumDown = 1_073_742_103, KbdIllumUp = 1_073_742_104, Eject = 1_073_742_105, Sleep = 1_073_742_106,
}
Expand description

Represent a keyboard key. Keycodes follows SDL http://wiki.libsdl.org/SDLKeycodeLookup

Variants§

§

Unknown = 0

§

Backspace = 8

§

Tab = 9

§

Return = 13

§

Escape = 27

§

Space = 32

§

Exclaim = 33

§

Quotedbl = 34

§

Hash = 35

§

Dollar = 36

§

Percent = 37

§

Ampersand = 38

§

Quote = 39

§

LeftParen = 40

§

RightParen = 41

§

Asterisk = 42

§

Plus = 43

§

Comma = 44

§

Minus = 45

§

Period = 46

§

Slash = 47

§

D0 = 48

§

D1 = 49

§

D2 = 50

§

D3 = 51

§

D4 = 52

§

D5 = 53

§

D6 = 54

§

D7 = 55

§

D8 = 56

§

D9 = 57

§

Colon = 58

§

Semicolon = 59

§

Less = 60

§

Equals = 61

§

Greater = 62

§

Question = 63

§

At = 64

§

LeftBracket = 91

§

Backslash = 92

§

RightBracket = 93

§

Caret = 94

§

Underscore = 95

§

Backquote = 96

§

A = 97

§

B = 98

§

C = 99

§

D = 100

§

E = 101

§

F = 102

§

G = 103

§

H = 104

§

I = 105

§

J = 106

§

K = 107

§

L = 108

§

M = 109

§

N = 110

§

O = 111

§

P = 112

§

Q = 113

§

R = 114

§

S = 115

§

T = 116

§

U = 117

§

V = 118

§

W = 119

§

X = 120

§

Y = 121

§

Z = 122

§

Delete = 127

§

CapsLock = 1_073_741_881

§

F1 = 1_073_741_882

§

F2 = 1_073_741_883

§

F3 = 1_073_741_884

§

F4 = 1_073_741_885

§

F5 = 1_073_741_886

§

F6 = 1_073_741_887

§

F7 = 1_073_741_888

§

F8 = 1_073_741_889

§

F9 = 1_073_741_890

§

F10 = 1_073_741_891

§

F11 = 1_073_741_892

§

F12 = 1_073_741_893

§

PrintScreen = 1_073_741_894

§

ScrollLock = 1_073_741_895

§

Pause = 1_073_741_896

§

Insert = 1_073_741_897

§

Home = 1_073_741_898

§

PageUp = 1_073_741_899

§

End = 1_073_741_901

§

PageDown = 1_073_741_902

§

Right = 1_073_741_903

§

Left = 1_073_741_904

§

Down = 1_073_741_905

§

Up = 1_073_741_906

§

NumLockClear = 1_073_741_907

§

NumPadDivide = 1_073_741_908

§

NumPadMultiply = 1_073_741_909

§

NumPadMinus = 1_073_741_910

§

NumPadPlus = 1_073_741_911

§

NumPadEnter = 1_073_741_912

§

NumPad1 = 1_073_741_913

§

NumPad2 = 1_073_741_914

§

NumPad3 = 1_073_741_915

§

NumPad4 = 1_073_741_916

§

NumPad5 = 1_073_741_917

§

NumPad6 = 1_073_741_918

§

NumPad7 = 1_073_741_919

§

NumPad8 = 1_073_741_920

§

NumPad9 = 1_073_741_921

§

NumPad0 = 1_073_741_922

§

NumPadPeriod = 1_073_741_923

§

Application = 1_073_741_925

§

Power = 1_073_741_926

§

NumPadEquals = 1_073_741_927

§

F13 = 1_073_741_928

§

F14 = 1_073_741_929

§

F15 = 1_073_741_930

§

F16 = 1_073_741_931

§

F17 = 1_073_741_932

§

F18 = 1_073_741_933

§

F19 = 1_073_741_934

§

F20 = 1_073_741_935

§

F21 = 1_073_741_936

§

F22 = 1_073_741_937

§

F23 = 1_073_741_938

§

F24 = 1_073_741_939

§

Execute = 1_073_741_940

§

Help = 1_073_741_941

§

Menu = 1_073_741_942

§

Select = 1_073_741_943

§

Stop = 1_073_741_944

§

Again = 1_073_741_945

§

Undo = 1_073_741_946

§

Cut = 1_073_741_947

§

Copy = 1_073_741_948

§

Paste = 1_073_741_949

§

Find = 1_073_741_950

§

Mute = 1_073_741_951

§

VolumeUp = 1_073_741_952

§

VolumeDown = 1_073_741_953

§

NumPadComma = 1_073_741_957

§

NumPadEqualsAS400 = 1_073_741_958

§

AltErase = 1_073_741_977

§

Sysreq = 1_073_741_978

§

Cancel = 1_073_741_979

§

Clear = 1_073_741_980

§

Prior = 1_073_741_981

§

Return2 = 1_073_741_982

§

Separator = 1_073_741_983

§

Out = 1_073_741_984

§

Oper = 1_073_741_985

§

ClearAgain = 1_073_741_986

§

CrSel = 1_073_741_987

§

ExSel = 1_073_741_988

§

NumPad00 = 1_073_742_000

§

NumPad000 = 1_073_742_001

§

ThousandsSeparator = 1_073_742_002

§

DecimalSeparator = 1_073_742_003

§

CurrencyUnit = 1_073_742_004

§

CurrencySubUnit = 1_073_742_005

§

NumPadLeftParen = 1_073_742_006

§

NumPadRightParen = 1_073_742_007

§

NumPadLeftBrace = 1_073_742_008

§

NumPadRightBrace = 1_073_742_009

§

NumPadTab = 1_073_742_010

§

NumPadBackspace = 1_073_742_011

§

NumPadA = 1_073_742_012

§

NumPadB = 1_073_742_013

§

NumPadC = 1_073_742_014

§

NumPadD = 1_073_742_015

§

NumPadE = 1_073_742_016

§

NumPadF = 1_073_742_017

§

NumPadXor = 1_073_742_018

§

NumPadPower = 1_073_742_019

§

NumPadPercent = 1_073_742_020

§

NumPadLess = 1_073_742_021

§

NumPadGreater = 1_073_742_022

§

NumPadAmpersand = 1_073_742_023

§

NumPadDblAmpersand = 1_073_742_024

§

NumPadVerticalBar = 1_073_742_025

§

NumPadDblVerticalBar = 1_073_742_026

§

NumPadColon = 1_073_742_027

§

NumPadHash = 1_073_742_028

§

NumPadSpace = 1_073_742_029

§

NumPadAt = 1_073_742_030

§

NumPadExclam = 1_073_742_031

§

NumPadMemStore = 1_073_742_032

§

NumPadMemRecall = 1_073_742_033

§

NumPadMemClear = 1_073_742_034

§

NumPadMemAdd = 1_073_742_035

§

NumPadMemSubtract = 1_073_742_036

§

NumPadMemMultiply = 1_073_742_037

§

NumPadMemDivide = 1_073_742_038

§

NumPadPlusMinus = 1_073_742_039

§

NumPadClear = 1_073_742_040

§

NumPadClearEntry = 1_073_742_041

§

NumPadBinary = 1_073_742_042

§

NumPadOctal = 1_073_742_043

§

NumPadDecimal = 1_073_742_044

§

NumPadHexadecimal = 1_073_742_045

§

LCtrl = 1_073_742_048

§

LShift = 1_073_742_049

§

LAlt = 1_073_742_050

§

LGui = 1_073_742_051

§

RCtrl = 1_073_742_052

§

RShift = 1_073_742_053

§

RAlt = 1_073_742_054

§

RGui = 1_073_742_055

§

Mode = 1_073_742_081

§

AudioNext = 1_073_742_082

§

AudioPrev = 1_073_742_083

§

AudioStop = 1_073_742_084

§

AudioPlay = 1_073_742_085

§

AudioMute = 1_073_742_086

§

MediaSelect = 1_073_742_087

§

Www = 1_073_742_088

§

Mail = 1_073_742_089

§

Calculator = 1_073_742_090

§

Computer = 1_073_742_091

§

AcSearch = 1_073_742_092

§

AcHome = 1_073_742_093

§

AcBack = 1_073_742_094

§

AcForward = 1_073_742_095

§

AcStop = 1_073_742_096

§

AcRefresh = 1_073_742_097

§

AcBookmarks = 1_073_742_098

§

BrightnessDown = 1_073_742_099

§

BrightnessUp = 1_073_742_100

§

DisplaySwitch = 1_073_742_101

§

KbdIllumToggle = 1_073_742_102

§

KbdIllumDown = 1_073_742_103

§

KbdIllumUp = 1_073_742_104

§

Eject = 1_073_742_105

§

Sleep = 1_073_742_106

Implementations§

source§

impl Key

source

pub fn code(&self) -> i32

Returns an id of the key

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<(), Error>

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

impl<'de> Deserialize<'de> for Key

source§

fn deserialize<__D>( __deserializer: __D ) -> Result<Key, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
source§

impl From<Key> for Button

source§

fn from(key: Key) -> Button

Converts to this type from the input type.
source§

impl From<u32> for Key

source§

fn from(val: u32) -> Key

Converts to this type from the input type.
source§

impl Hash for Key

source§

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

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 Serialize for Key

source§

fn serialize<__S>( &self, __serializer: __S ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
source§

impl Copy for Key

source§

impl Eq for Key

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 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> Pointable for T

source§

const ALIGN: usize = _

The alignment of pointer.
§

type Init = T

The type for initializers.
source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
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.
source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,