Skip to main content

KeyCode

Enum KeyCode 

Source
#[non_exhaustive]
pub enum KeyCode {
Show 194 variants Backquote, Backslash, BracketLeft, BracketRight, Comma, Digit0, Digit1, Digit2, Digit3, Digit4, Digit5, Digit6, Digit7, Digit8, Digit9, Equal, IntlBackslash, IntlRo, IntlYen, KeyA, KeyB, KeyC, KeyD, KeyE, KeyF, KeyG, KeyH, KeyI, KeyJ, KeyK, KeyL, KeyM, KeyN, KeyO, KeyP, KeyQ, KeyR, KeyS, KeyT, KeyU, KeyV, KeyW, KeyX, KeyY, KeyZ, Minus, Period, Quote, Semicolon, Slash, AltLeft, AltRight, Backspace, CapsLock, ContextMenu, ControlLeft, ControlRight, Enter, SuperLeft, SuperRight, ShiftLeft, ShiftRight, Space, Tab, Convert, KanaMode, Lang1, Lang2, Lang3, Lang4, Lang5, NonConvert, Delete, End, Help, Home, Insert, PageDown, PageUp, ArrowDown, ArrowLeft, ArrowRight, ArrowUp, NumLock, Numpad0, Numpad1, Numpad2, Numpad3, Numpad4, Numpad5, Numpad6, Numpad7, Numpad8, Numpad9, NumpadAdd, NumpadBackspace, NumpadClear, NumpadClearEntry, NumpadComma, NumpadDecimal, NumpadDivide, NumpadEnter, NumpadEqual, NumpadHash, NumpadMemoryAdd, NumpadMemoryClear, NumpadMemoryRecall, NumpadMemoryStore, NumpadMemorySubtract, NumpadMultiply, NumpadParenLeft, NumpadParenRight, NumpadStar, NumpadSubtract, Escape, Fn, FnLock, PrintScreen, ScrollLock, Pause, BrowserBack, BrowserFavorites, BrowserForward, BrowserHome, BrowserRefresh, BrowserSearch, BrowserStop, Eject, LaunchApp1, LaunchApp2, LaunchMail, MediaPlayPause, MediaSelect, MediaStop, MediaTrackNext, MediaTrackPrevious, Power, Sleep, AudioVolumeDown, AudioVolumeMute, AudioVolumeUp, WakeUp, Meta, Hyper, Turbo, Abort, Resume, Suspend, Again, Copy, Cut, Find, Open, Paste, Props, Select, Undo, Hiragana, Katakana, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, F25, F26, F27, F28, F29, F30, F31, F32, F33, F34, F35,
}
Expand description

A physical key by its position, such as KeyK or Digit1, whatever the layout.

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.
§

Backquote

Backquote.

§

Backslash

Backslash.

§

BracketLeft

BracketLeft.

§

BracketRight

BracketRight.

§

Comma

Comma.

§

Digit0

Digit0.

§

Digit1

Digit1.

§

Digit2

Digit2.

§

Digit3

Digit3.

§

Digit4

Digit4.

§

Digit5

Digit5.

§

Digit6

Digit6.

§

Digit7

Digit7.

§

Digit8

Digit8.

§

Digit9

Digit9.

§

Equal

Equal.

§

IntlBackslash

IntlBackslash.

§

IntlRo

IntlRo.

§

IntlYen

IntlYen.

§

KeyA

KeyA.

§

KeyB

KeyB.

§

KeyC

KeyC.

§

KeyD

KeyD.

§

KeyE

KeyE.

§

KeyF

KeyF.

§

KeyG

KeyG.

§

KeyH

KeyH.

§

KeyI

KeyI.

§

KeyJ

KeyJ.

§

KeyK

KeyK.

§

KeyL

KeyL.

§

KeyM

KeyM.

§

KeyN

KeyN.

§

KeyO

KeyO.

§

KeyP

KeyP.

§

KeyQ

KeyQ.

§

KeyR

KeyR.

§

KeyS

KeyS.

§

KeyT

KeyT.

§

KeyU

KeyU.

§

KeyV

KeyV.

§

KeyW

KeyW.

§

KeyX

KeyX.

§

KeyY

KeyY.

§

KeyZ

KeyZ.

§

Minus

Minus.

§

Period

Period.

§

Quote

Quote.

§

Semicolon

Semicolon.

§

Slash

Slash.

§

AltLeft

AltLeft.

§

AltRight

AltRight.

§

Backspace

Backspace.

§

CapsLock

CapsLock.

§

ContextMenu

ContextMenu.

§

ControlLeft

ControlLeft.

§

ControlRight

ControlRight.

§

Enter

Enter.

§

SuperLeft

SuperLeft.

§

SuperRight

SuperRight.

§

ShiftLeft

ShiftLeft.

§

ShiftRight

ShiftRight.

§

Space

Space.

§

Tab

Tab.

§

Convert

Convert.

§

KanaMode

KanaMode.

§

Lang1

Lang1.

§

Lang2

Lang2.

§

Lang3

Lang3.

§

Lang4

Lang4.

§

Lang5

Lang5.

§

NonConvert

NonConvert.

§

Delete

Delete.

§

End

End.

§

Help

Help.

§

Home

Home.

§

Insert

Insert.

§

PageDown

PageDown.

§

PageUp

PageUp.

§

ArrowDown

ArrowDown.

§

ArrowLeft

ArrowLeft.

§

ArrowRight

ArrowRight.

§

ArrowUp

ArrowUp.

§

NumLock

NumLock.

§

Numpad0

Numpad0.

§

Numpad1

Numpad1.

§

Numpad2

Numpad2.

§

Numpad3

Numpad3.

§

Numpad4

Numpad4.

§

Numpad5

Numpad5.

§

Numpad6

Numpad6.

§

Numpad7

Numpad7.

§

Numpad8

Numpad8.

§

Numpad9

Numpad9.

§

NumpadAdd

NumpadAdd.

§

NumpadBackspace

NumpadBackspace.

§

NumpadClear

NumpadClear.

§

NumpadClearEntry

NumpadClearEntry.

§

NumpadComma

NumpadComma.

§

NumpadDecimal

NumpadDecimal.

§

NumpadDivide

NumpadDivide.

§

NumpadEnter

NumpadEnter.

§

NumpadEqual

NumpadEqual.

§

NumpadHash

NumpadHash.

§

NumpadMemoryAdd

NumpadMemoryAdd.

§

NumpadMemoryClear

NumpadMemoryClear.

§

NumpadMemoryRecall

NumpadMemoryRecall.

§

NumpadMemoryStore

NumpadMemoryStore.

§

NumpadMemorySubtract

NumpadMemorySubtract.

§

NumpadMultiply

NumpadMultiply.

§

NumpadParenLeft

NumpadParenLeft.

§

NumpadParenRight

NumpadParenRight.

§

NumpadStar

NumpadStar.

§

NumpadSubtract

NumpadSubtract.

§

Escape

Escape.

§

Fn

Fn.

§

FnLock

FnLock.

§

PrintScreen

PrintScreen.

§

ScrollLock

ScrollLock.

§

Pause

Pause.

§

BrowserBack

BrowserBack.

§

BrowserFavorites

BrowserFavorites.

§

BrowserForward

BrowserForward.

§

BrowserHome

BrowserHome.

§

BrowserRefresh

BrowserRefresh.

§

BrowserSearch

BrowserSearch.

§

BrowserStop

BrowserStop.

§

Eject

Eject.

§

LaunchApp1

LaunchApp1.

§

LaunchApp2

LaunchApp2.

§

LaunchMail

LaunchMail.

§

MediaPlayPause

MediaPlayPause.

§

MediaSelect

MediaSelect.

§

MediaStop

MediaStop.

§

MediaTrackNext

MediaTrackNext.

§

MediaTrackPrevious

MediaTrackPrevious.

§

Power

Power.

§

Sleep

Sleep.

§

AudioVolumeDown

AudioVolumeDown.

§

AudioVolumeMute

AudioVolumeMute.

§

AudioVolumeUp

AudioVolumeUp.

§

WakeUp

WakeUp.

§

Meta

Meta.

§

Hyper

Hyper.

§

Turbo

Turbo.

§

Abort

Abort.

§

Resume

Resume.

§

Suspend

Suspend.

§

Again

Again.

§

Copy

Copy.

§

Cut

Cut.

§

Find

Find.

§

Open

Open.

§

Paste

Paste.

§

Props

Props.

§

Select

Select.

§

Undo

Undo.

§

Hiragana

Hiragana.

§

Katakana

Katakana.

§

F1

F1.

§

F2

F2.

§

F3

F3.

§

F4

F4.

§

F5

F5.

§

F6

F6.

§

F7

F7.

§

F8

F8.

§

F9

F9.

§

F10

F10.

§

F11

F11.

§

F12

F12.

§

F13

F13.

§

F14

F14.

§

F15

F15.

§

F16

F16.

§

F17

F17.

§

F18

F18.

§

F19

F19.

§

F20

F20.

§

F21

F21.

§

F22

F22.

§

F23

F23.

§

F24

F24.

§

F25

F25.

§

F26

F26.

§

F27

F27.

§

F28

F28.

§

F29

F29.

§

F30

F30.

§

F31

F31.

§

F32

F32.

§

F33

F33.

§

F34

F34.

§

F35

F35.

Implementations§

Source§

impl KeyCode

Source

pub const ALL: &'static [Self]

Every value, in iced’s declaration order.

Source

pub const fn name(self) -> &'static str

The name, as written in a chord.

Source

pub fn from_name(name: &str) -> Option<Self>

The value with this exact name.

Trait Implementations§

Source§

impl Clone for KeyCode

Source§

fn clone(&self) -> Self

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 KeyCode

Source§

impl Debug for KeyCode

Source§

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

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

impl Display for KeyCode

Source§

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

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

impl Eq for KeyCode

Source§

impl From<KeyCode> for Keystroke

Source§

fn from(code: KeyCode) -> Self

Converts to this type from the input type.
Source§

impl Hash for KeyCode

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 KeyCode

Source§

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

This method returns an Ordering between self and other. Read more
1.21.0 (const: unstable) · Source§

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

Compares and returns the maximum of two values. Read more
1.21.0 (const: unstable) · Source§

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

Compares and returns the minimum of two values. Read more
1.50.0 (const: unstable) · Source§

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

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

fn clamp_to<R>(self, range: R) -> Self
where Self: Sized, R: ClampBounds<Self>,

🔬This is a nightly-only experimental API. (clamp_to)
Restrict a value to a certain range. Read more
Source§

impl PartialEq for KeyCode

Source§

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

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

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

Inequality operator !=. Read more
Source§

impl PartialOrd for KeyCode

Source§

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

This method returns an ordering between self and other values if one exists. Read more
1.0.0 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 (const: unstable) · 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 StructuralPartialEq for KeyCode

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, 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> ToString for T
where T: Display + ?Sized,

Source§

fn to_string(&self) -> String

Converts the given value to a String. Read more
Source§

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

Source§

type Error = !

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

fn try_from(value: U) -> Result<T, !>

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.