KeyCode

Enum KeyCode 

Source
#[non_exhaustive]
pub enum KeyCode {
Show 215 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, MetaLeft, MetaRight, 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, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, 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, Again, Copy, Cut, Find, Open, Paste, Props, Select, Undo, Gamepad0, Gamepad1, Gamepad2, Gamepad3, Gamepad4, Gamepad5, Gamepad6, Gamepad7, Gamepad8, Gamepad9, Gamepad10, Gamepad11, Gamepad12, Gamepad13, Gamepad14, Gamepad15, Gamepad16, Gamepad17, Gamepad18, Gamepad19, BrightnessDown, BrightnessUp, DisplayToggleIntExt, KeyboardLayoutSelect, LaunchAssistant, LaunchControlPanel, LaunchScreenSaver, MailForward, MailReply, MailSend, MediaFastForward, MediaPlay, MediaPause, MediaRecord, MediaRewind, MicrophoneMuteToggle, PrivacyScreenToggle, SelectTask, ShowAllWindows, ZoomToggle,
}
Expand description

A key code represents a physical key on a keyboard and is independent of the keyboard layout. The values are based on the UI Events KeyboardEvent code Values specification. There are some additional values for Gamepad support and some browser specific values.

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

Backtick and ~ on a US keyboard. This is the 半角/全角/漢字 (hankaku/zenkaku/kanji) key on Japanese keyboards

USB HID:

  • Keyboard Grave Accent and Tilde Keyboard Page 0x35
§

Backslash

Used for both the US \| (on the 101-key layout) and also for the key located between the " and Enter keys on row C of the 102-, 104- and 106-key layouts. Labelled #~ on a UK (102) keyboard.

USB HID:

  • Keyboard \ and | Keyboard Page 0x31
  • Keyboard Non-US # and ~ Keyboard Page 0x32
§

BracketLeft

[{ on a US keyboard.

USB HID:

  • Keyboard [ and { Keyboard Page 0x2f
§

BracketRight

]} on a US keyboard.

USB HID:

  • Keyboard ] and } Keyboard Page 0x30
§

Comma

,< on a US keyboard.

USB HID:

  • Keyboard , and < Keyboard Page 0x36
§

Digit0

0) on a US keyboard.

USB HID:

  • Keyboard 0 and ) Keyboard Page 0x27
§

Digit1

1! on a US keyboard.

USB HID:

  • Keyboard 1 and ! Keyboard Page 0x1e
§

Digit2

2@ on a US keyboard.

USB HID:

  • Keyboard 2 and @ Keyboard Page 0x1f
§

Digit3

3# on a US keyboard.

USB HID:

  • Keyboard 3 and # Keyboard Page 0x20
§

Digit4

4$ on a US keyboard.

USB HID:

  • Keyboard 4 and $ Keyboard Page 0x21
§

Digit5

5% on a US keyboard.

USB HID:

  • Keyboard 5 and % Keyboard Page 0x22
§

Digit6

6^ on a US keyboard.

USB HID:

  • Keyboard 6 and ^ Keyboard Page 0x23
§

Digit7

7& on a US keyboard.

USB HID:

  • Keyboard 7 and & Keyboard Page 0x24
§

Digit8

8* on a US keyboard.

USB HID:

  • Keyboard 8 and * Keyboard Page 0x25
§

Digit9

9( on a US keyboard.

USB HID:

  • Keyboard 9 and ( Keyboard Page 0x26
§

Equal

=+ on a US keyboard.

USB HID:

  • Keyboard = and + Keyboard Page 0x2e
§

IntlBackslash

Located between the left Shift and Z keys. Labelled \| on a UK keyboard.

USB HID:

  • Keyboard Non-US \ and | Keyboard Page 0x64
§

IntlRo

Located between the / and right Shift keys. Labelled \ろ (ro) on a Japanese keyboard.

USB HID:

  • Keyboard International1 Keyboard Page 0x87
§

IntlYen

Located between the = and Backspace keys. Labelled ¥ (yen) on a Japanese keyboard. \/ on a Russian keyboard.

USB HID:

  • Keyboard International3 Keyboard Page 0x89
§

KeyA

a on a US keyboard. Labelled q on an AZERTY (e.g., French) keyboard.

USB HID:

  • Keyboard a and A Keyboard Page 0x4
§

KeyB

b on a US keyboard.

USB HID:

  • Keyboard b and B Keyboard Page 0x5
§

KeyC

c on a US keyboard.

USB HID:

  • Keyboard c and C Keyboard Page 0x6
§

KeyD

d on a US keyboard.

USB HID:

  • Keyboard d and D Keyboard Page 0x7
§

KeyE

e on a US keyboard.

USB HID:

  • Keyboard e and E Keyboard Page 0x8
§

KeyF

f on a US keyboard.

USB HID:

  • Keyboard f and F Keyboard Page 0x9
§

KeyG

g on a US keyboard.

USB HID:

  • Keyboard g and G Keyboard Page 0xa
§

KeyH

h on a US keyboard.

USB HID:

  • Keyboard h and H Keyboard Page 0xb
§

KeyI

i on a US keyboard.

USB HID:

  • Keyboard i and I Keyboard Page 0xc
§

KeyJ

j on a US keyboard.

USB HID:

  • Keyboard j and J Keyboard Page 0xd
§

KeyK

k on a US keyboard.

USB HID:

  • Keyboard k and K Keyboard Page 0xe
§

KeyL

l on a US keyboard.

USB HID:

  • Keyboard l and L Keyboard Page 0xf
§

KeyM

m on a US keyboard.

USB HID:

  • Keyboard m and M Keyboard Page 0x10
§

KeyN

n on a US keyboard.

USB HID:

  • Keyboard n and N Keyboard Page 0x11
§

KeyO

o on a US keyboard.

USB HID:

  • Keyboard o and O Keyboard Page 0x12
§

KeyP

p on a US keyboard.

USB HID:

  • Keyboard p and P Keyboard Page 0x13
§

KeyQ

q on a US keyboard. Labelled a on an AZERTY (e.g., French) keyboard.

USB HID:

  • Keyboard q and Q Keyboard Page 0x14
§

KeyR

r on a US keyboard.

USB HID:

  • Keyboard r and R Keyboard Page 0x15
§

KeyS

s on a US keyboard.

USB HID:

  • Keyboard s and S Keyboard Page 0x16
§

KeyT

t on a US keyboard.

USB HID:

  • Keyboard t and T Keyboard Page 0x17
§

KeyU

u on a US keyboard.

USB HID:

  • Keyboard u and U Keyboard Page 0x18
§

KeyV

v on a US keyboard.

USB HID:

  • Keyboard v and V Keyboard Page 0x19
§

KeyW

w on a US keyboard. Labelled z on an AZERTY (e.g., French) keyboard.

USB HID:

  • Keyboard w and W Keyboard Page 0x1a
§

KeyX

x on a US keyboard.

USB HID:

  • Keyboard x and X Keyboard Page 0x1b
§

KeyY

y on a US keyboard. Labelled z on a QWERTZ (e.g., German) keyboard.

USB HID:

  • Keyboard y and Y Keyboard Page 0x1c
§

KeyZ

z on a US keyboard. Labelled w on an AZERTY (e.g., French) keyboard, and y on a QWERTZ (e.g., German) keyboard.

USB HID:

  • Keyboard z and Z Keyboard Page 0x1d
§

Minus

-_ on a US keyboard.

USB HID:

  • Keyboard - and (underscore) Keyboard Page 0x2d
§

Period

.> on a US keyboard.

USB HID:

  • Keyboard . and > Keyboard Page 0x37
§

Quote

'" on a US keyboard.

USB HID:

  • Keyboard ‘ and “ Keyboard Page 0x34
§

Semicolon

;: on a US keyboard.

USB HID:

  • Keyboard ; and : Keyboard Page 0x33
§

Slash

/? on a US keyboard.

USB HID:

  • Keyboard / and ? Keyboard Page 0x38
§

AltLeft

Alt, Option or .

USB HID:

  • Keyboard LeftAlt Keyboard Page 0xe2
§

AltRight

Alt, Option or . This is labelled AltGr key on many keyboard layouts.

USB HID:

  • Keyboard RightAlt Keyboard Page 0xe6
§

Backspace

Backspace or . Labelled Delete on Apple keyboards.

USB HID:

  • Keyboard DELETE (Backspace) Keyboard Page 0x2a
§

CapsLock

CapsLock or

USB HID:

  • Keyboard Caps Lock Keyboard Page 0x39
§

ContextMenu

The application context menu key, which is typically found between the right Meta key and the right Control key.

USB HID:

  • Keyboard Application Keyboard Page 0x65
§

ControlLeft

Control or

USB HID:

  • Keyboard LeftControl Keyboard Page 0xe0
§

ControlRight

Control or

USB HID:

  • Keyboard RightControl Keyboard Page 0xe4
§

Enter

Enter or . Labelled Return on Apple keyboards.

USB HID:

  • Keyboard Return (ENTER) Keyboard Page 0x28
  • Enter Channel Consumer Page 0x84
§

MetaLeft

The Windows, , Command or other OS symbol key.

USB HID:

  • Keyboard Left GUI Keyboard Page 0xe3
§

MetaRight

The Windows, , Command or other OS symbol key.

USB HID:

  • Keyboard Right GUI Keyboard Page 0xe7
§

ShiftLeft

Shift or

USB HID:

  • Keyboard LeftShift Keyboard Page 0xe1
§

ShiftRight

Shift or

USB HID:

  • Keyboard RightShift Keyboard Page 0xe5
§

Space

  (space)

USB HID:

  • Keyboard Spacebar Keyboard Page 0x2c
§

Tab

Tab or

USB HID:

  • Keyboard Tab Keyboard Page 0x2b
§

Convert

Japanese: 変換 (henkan)

USB HID:

  • Keyboard International4 Keyboard Page 0x8a
§

KanaMode

Japanese: カタカナ/ひらがな/ローマ字 (katakana/hiragana/romaji)

USB HID:

  • Keyboard International2 Keyboard Page 0x88
§

Lang1

Korean: HangulMode 한/영 (han/yeong)

Japanese (Mac keyboard): かな (kana)

USB HID:

  • Keyboard LANG1 Keyboard Page 0x90
§

Lang2

Korean: Hanja 한자 (hanja)

Japanese (Mac keyboard): 英数 (eisu)

USB HID:

  • Keyboard LANG2 Keyboard Page 0x91
§

Lang3

Japanese (word-processing keyboard): Katakana

USB HID:

  • Keyboard LANG3 Keyboard Page 0x92
§

Lang4

Japanese (word-processing keyboard): Hiragana

USB HID:

  • Keyboard LANG4 Keyboard Page 0x93
§

Lang5

Japanese (word-processing keyboard): Zenkaku/Hankaku

USB HID:

  • Keyboard LANG5 Keyboard Page 0x94
§

NonConvert

Japanese: 無変換 (muhenkan)

USB HID:

  • Keyboard International5 Keyboard Page 0x8b
§

Delete

. The forward delete key. Note that on Apple keyboards, the key labelled Delete on the main part of the keyboard should be encoded as "Backspace".

USB HID:

  • Keyboard Delete Forward Keyboard Page 0x4c
  • Keyboard Clear Keyboard Page 0x9c
  • Keypad Clear Keyboard Page 0xd8
  • AC Delete Consumer Page 0x26a
§

End

Page Down, End or

USB HID:

  • Keyboard End Keyboard Page 0x4d
§

Help

Help. Not present on standard PC keyboards.

USB HID:

  • Keyboard Help Keyboard Page 0x75
  • Help Consumer Page 0x95
  • AL Integrated Help Center Consumer Page 0x1a6
§

Home

Home or

USB HID:

  • Keyboard Home Keyboard Page 0x4a
§

Insert

Insert or Ins. Not present on Apple keyboards.

USB HID:

  • Keyboard Insert Keyboard Page 0x49
  • AC Insert Mode Consumer Page 0x269
§

PageDown

Page Down, PgDn or

USB HID:

  • Keyboard PageDown Keyboard Page 0x4e
§

PageUp

Page Up, PgUp or

USB HID:

  • Keyboard PageUp Keyboard Page 0x4b
§

ArrowDown

USB HID:

  • Keyboard DownArrow Keyboard Page 0x51
  • Menu Down Consumer Page 0x43
§

ArrowLeft

USB HID:

  • Keyboard LeftArrow Keyboard Page 0x50
  • Menu Left Consumer Page 0x44
§

ArrowRight

USB HID:

  • Keyboard RightArrow Keyboard Page 0x4f
  • Menu Right Consumer Page 0x45
§

ArrowUp

USB HID:

  • Keyboard UpArrow Keyboard Page 0x52
  • Menu Up Consumer Page 0x42
§

NumLock

On the Mac, the "NumLock" code should be used for the numpad Clear key.

USB HID:

  • Keypad Num Lock and Clear Keyboard Page 0x53
§

Numpad0

0 Ins on a keyboard

0 on a phone or remote control

USB HID:

  • Keypad 0 and Insert Keyboard Page 0x62
  • Phone Key 0 Telephony Device Page 0xb0
§

Numpad1

1 End on a keyboard

1 or 1 QZ on a phone or remote control

USB HID:

  • Keypad 1 and End Keyboard Page 0x59
  • Phone Key 1 Telephony Device Page 0xb1
§

Numpad2

2 ↓ on a keyboard

2 ABC on a phone or remote control

USB HID:

  • Keypad 2 and Down Arrow Keyboard Page 0x5a
  • Phone Key 2 Telephony Device Page 0xb2
§

Numpad3

3 PgDn on a keyboard

3 DEF on a phone or remote control

USB HID:

  • Keypad 3 and PageDn Keyboard Page 0x5b
  • Phone Key 3 Telephony Device Page 0xb3
§

Numpad4

4 ← on a keyboard

4 GHI on a phone or remote control

USB HID:

  • Keypad 4 and Left Arrow Keyboard Page 0x5c
  • Phone Key 4 Telephony Device Page 0xb4
§

Numpad5

5 on a keyboard

5 JKL on a phone or remote control

USB HID:

  • Keypad 5 Keyboard Page 0x5d
  • Phone Key 5 Telephony Device Page 0xb5
§

Numpad6

6 → on a keyboard

6 MNO on a phone or remote control

USB HID:

  • Keypad 6 and Right Arrow Keyboard Page 0x5e
  • Phone Key 6 Telephony Device Page 0xb6
§

Numpad7

7 Home on a keyboard

7 PQRS or 7 PRS on a phone or remote control

USB HID:

  • Keypad 7 and Home Keyboard Page 0x5f
  • Phone Key 7 Telephony Device Page 0xb7
§

Numpad8

8 ↑ on a keyboard

8 TUV on a phone or remote control

USB HID:

  • Keypad 8 and Up Arrow Keyboard Page 0x60
  • Phone Key 8 Telephony Device Page 0xb8
§

Numpad9

9 PgUp on a keyboard

9 WXYZ or 9 WXY on a phone or remote control

USB HID:

  • Keypad 9 and PageUp Keyboard Page 0x61
  • Phone Key 9 Telephony Device Page 0xb9
§

NumpadAdd

+

USB HID:

  • Keypad + Keyboard Page 0x57
  • Menu Value Increase Consumer Page 0x47
§

NumpadBackspace

Found on the Microsoft Natural Keyboard.

USB HID:

  • Keypad Backspace Keyboard Page 0xbb
§

NumpadClear

C or AC (All Clear). Also for use with numpads that have a Clear key that is separate from the NumLock key. On the Mac, the numpad Clear key should always be encoded as "NumLock".

USB HID:

  • Keypad Clear Keyboard Page 0xd8
§

NumpadClearEntry

CE (Clear Entry)

USB HID:

  • Keypad Clear Entry Keyboard Page 0xd9
§

NumpadComma

, (thousands separator). For locales where the thousands separator is a “.” (e.g., Brazil), this key may generate a ..

USB HID:

  • Keypad Comma Keyboard Page 0x85
§

NumpadDecimal

. Del. For locales where the decimal separator is “,” (e.g., Brazil), this key may generate a ,.

USB HID:

  • Keypad . and Delete Keyboard Page 0x63
§

NumpadDivide

/

USB HID:

  • Keypad / Keyboard Page 0x54
§

NumpadEnter

USB HID:

  • Keypad ENTER Keyboard Page 0x58
§

NumpadEqual

=

USB HID:

  • Keypad = Keyboard Page 0x67
§

NumpadHash

# on a phone or remote control device. This key is typically found below the 9 key and to the right of the 0 key.

USB HID:

  • Phone Key Pound Telephony Device Page 0xbb
§

NumpadMemoryAdd

M+ Add current entry to the value stored in memory.

USB HID:

  • Keypad Memory Add Keyboard Page 0xd3
§

NumpadMemoryClear

MC Clear the value stored in memory.

USB HID:

  • Keypad Memory Clear Keyboard Page 0xd2
§

NumpadMemoryRecall

MR Replace the current entry with the value stored in memory.

USB HID:

  • Keypad Memory Recall Keyboard Page 0xd1
§

NumpadMemoryStore

MS Replace the value stored in memory with the current entry.

USB HID:

  • Keypad Memory Store Keyboard Page 0xd0
§

NumpadMemorySubtract

M- Subtract current entry from the value stored in memory.

USB HID:

  • Keypad Memory Subtract Keyboard Page 0xd4
§

NumpadMultiply

* on a keyboard. For use with numpads that provide mathematical operations (+, -, * and /).

Use KeyCode::NumpadStar for the * key on phones and remote controls.

USB HID:

  • Keypad * Keyboard Page 0x55
§

NumpadParenLeft

( Found on the Microsoft Natural Keyboard.

USB HID:

  • Keypad ( Keyboard Page 0xb6
§

NumpadParenRight

) Found on the Microsoft Natural Keyboard.

USB HID:

  • Keypad ) Keyboard Page 0xb7
§

NumpadStar

* on a phone or remote control device. This key is typically found below the 7 key and to the left of the 0 key.

Use KeyCode::NumpadMultiply for the * key on numeric keypads.

USB HID:

  • Phone Key Star Telephony Device Page 0xba
§

NumpadSubtract

-

USB HID:

  • Keypad - Keyboard Page 0x56
  • Menu Value Decrease Consumer Page 0x48
§

Escape

Esc or

USB HID:

  • Keyboard ESCAPE Keyboard Page 0x29
  • Menu Escape Consumer Page 0x46
§

F1

F1

USB HID:

  • Keyboard F1 Keyboard Page 0x3a
§

F2

F2

USB HID:

  • Keyboard F2 Keyboard Page 0x3b
§

F3

F3

USB HID:

  • Keyboard F3 Keyboard Page 0x3c
§

F4

F4

USB HID:

  • Keyboard F4 Keyboard Page 0x3d
§

F5

F5

USB HID:

  • Keyboard F5 Keyboard Page 0x3e
§

F6

F6

USB HID:

  • Keyboard F6 Keyboard Page 0x3f
§

F7

F7

USB HID:

  • Keyboard F7 Keyboard Page 0x40
§

F8

F8

USB HID:

  • Keyboard F8 Keyboard Page 0x41
§

F9

F9

USB HID:

  • Keyboard F9 Keyboard Page 0x42
§

F10

F10

USB HID:

  • Keyboard F10 Keyboard Page 0x43
§

F11

F11

USB HID:

  • Keyboard F11 Keyboard Page 0x44
§

F12

F12

USB HID:

  • Keyboard F12 Keyboard Page 0x45
§

F13

F13

USB HID:

  • Keyboard F13 Keyboard Page 0x68
§

F14

F14

USB HID:

  • Keyboard F14 Keyboard Page 0x69
§

F15

F15

USB HID:

  • Keyboard F15 Keyboard Page 0x6a
§

F16

F16

USB HID:

  • Keyboard F16 Keyboard Page 0x6b
§

F17

F17

USB HID:

  • Keyboard F17 Keyboard Page 0x6c
§

F18

F18

USB HID:

  • Keyboard F18 Keyboard Page 0x6d
§

F19

F19

USB HID:

  • Keyboard F19 Keyboard Page 0x6e
§

F20

F20

USB HID:

  • Keyboard F20 Keyboard Page 0x6f
§

F21

F21

USB HID:

  • Keyboard F21 Keyboard Page 0x70
§

F22

F22

USB HID:

  • Keyboard F22 Keyboard Page 0x71
§

F23

F23

USB HID:

  • Keyboard F23 Keyboard Page 0x72
§

F24

F24

USB HID:

  • Keyboard F24 Keyboard Page 0x73
§

Fn

Fn This is typically a hardware key that does not generate a separate code. Most keyboards do not place this key in the function section, but it is included here to keep it with related keys.

USB HID:

§

FnLock

FLock or FnLock. Function Lock key. Found on the Microsoft Natural Keyboard.

USB HID:

§

PrintScreen

PrtScr SysRq or Print Screen

USB HID:

  • Keyboard PrintScreen Keyboard Page 0x46
§

ScrollLock

Scroll Lock

USB HID:

  • Keyboard Scroll Lock Keyboard Page 0x47
§

Pause

Pause Break

USB HID:

  • Keyboard Pause Keyboard Page 0x48
  • Pause Consumer Page 0xb1
§

BrowserBack

Some laptops place this key to the left of the key.

USB HID:

  • Reserved Keyboard Page 0xf1
  • AC Back Consumer Page 0x224
§

BrowserFavorites

USB HID:

  • AL Programmable Button Configuration Consumer Page 0x182
  • AC Bookmarks Consumer Page 0x22a
§

BrowserForward

Some laptops place this key to the right of the key.

USB HID:

  • Reserved Keyboard Page 0xf2
  • AC Forward Consumer Page 0x225
§

BrowserHome

USB HID:

  • AC Home Consumer Page 0x223
§

BrowserRefresh

USB HID:

  • Reserved Keyboard Page 0xfa
  • AC Refresh Consumer Page 0x227
§

BrowserSearch

USB HID:

  • AC Search Consumer Page 0x221
§

BrowserStop

USB HID:

  • Keyboard Stop Keyboard Page 0x78
  • Reserved Keyboard Page 0xf3
  • AC Stop Consumer Page 0x226
§

Eject

Eject or . This key is placed in the function section on some Apple keyboards.

USB HID:

  • Reserved Keyboard Page 0xec
  • Eject Consumer Page 0xb8
§

LaunchApp1

Sometimes labelled My Computer on the keyboard

USB HID:

  • AL Local Machine Browser Consumer Page 0x194
  • AL File Browser Consumer Page 0x1b4
§

LaunchApp2

Sometimes labelled Calculator on the keyboard

USB HID:

  • Reserved Keyboard Page 0xfb
  • AL Calculator Consumer Page 0x192
§

LaunchMail

USB HID:

  • AL Email Reader Consumer Page 0x18a
§

MediaPlayPause

USB HID:

  • Reserved Keyboard Page 0xe8
  • Play/Pause Consumer Page 0xcd
§

MediaSelect

USB HID:

  • AL Consumer Control Configuration Consumer Page 0x183
§

MediaStop

USB HID:

  • Reserved Keyboard Page 0xe9
  • Stop Consumer Page 0xb7
§

MediaTrackNext

USB HID:

  • Reserved Keyboard Page 0xeb
  • Scan Next Track Consumer Page 0xb5
§

MediaTrackPrevious

USB HID:

  • Reserved Keyboard Page 0xea
  • Scan Previous Track Consumer Page 0xb6
§

Power

This key is placed in the function section on some Apple keyboards, replacing the Eject key.

USB HID:

  • Keyboard Power Keyboard Page 0x66
  • Power Consumer Page 0x30
§

Sleep

USB HID:

  • Reserved Keyboard Page 0xf8
  • Sleep Consumer Page 0x32
  • Sleep Mode Consumer Page 0x34
§

AudioVolumeDown

USB HID:

  • Keyboard Volume Down Keyboard Page 0x81
  • Reserved Keyboard Page 0xee
  • Volume Decrement Consumer Page 0xea
§

AudioVolumeMute

USB HID:

  • Keyboard Mute Keyboard Page 0x7f
  • Reserved Keyboard Page 0xef
  • Mute Consumer Page 0xe2
§

AudioVolumeUp

USB HID:

  • Keyboard Volume Up Keyboard Page 0x80
  • Reserved Keyboard Page 0xed
  • Volume Increment Consumer Page 0xe9
§

WakeUp

USB HID:

  • System Wake Up Generic Desktop Page 0x83
§

Again

Found on Sun’s USB keyboard.

USB HID:

  • Keyboard Again Keyboard Page 0x79
§

Copy

Found on Sun’s USB keyboard.

USB HID:

  • Keyboard Copy Keyboard Page 0x7c
  • AC Copy Consumer Page 0x21b
§

Cut

Found on Sun’s USB keyboard.

USB HID:

  • Keyboard Cut Keyboard Page 0x7b
  • AC Cut Consumer Page 0x21c
§

Find

Found on Sun’s USB keyboard.

USB HID:

  • Keyboard Find Keyboard Page 0x7e
  • Reserved Keyboard Page 0xf4
  • AC Find Consumer Page 0x21f
§

Open

Found on Sun’s USB keyboard.

USB HID:

  • Keyboard Execute Keyboard Page 0x74
  • AC Open Consumer Page 0x202
§

Paste

Found on Sun’s USB keyboard.

USB HID:

  • Keyboard Paste Keyboard Page 0x7d
  • AC Paste Consumer Page 0x21d
§

Props

Found on Sun’s USB keyboard.

USB HID:

  • Keyboard Menu Keyboard Page 0x76
  • AC Properties Consumer Page 0x209
§

Select

Found on Sun’s USB keyboard.

USB HID:

  • Keyboard Select Keyboard Page 0x77
§

Undo

Found on Sun’s USB keyboard.

USB HID:

  • Keyboard Undo Keyboard Page 0x7a
  • AC Undo Consumer Page 0x21a
§

Gamepad0

USB HID:

  • Button 1 (primary/trigger) Button Page 0x1
§

Gamepad1

USB HID:

  • Button 2 (secondary) Button Page 0x2
§

Gamepad2

USB HID:

  • Button 3 (tertiary) Button Page 0x3
§

Gamepad3

USB HID:

  • Button 4 Button Page 0x4
§

Gamepad4

USB HID:

  • Button 5 Button Page 0x5
§

Gamepad5

USB HID:

  • Button 6 Button Page 0x6
§

Gamepad6

USB HID:

  • Button 7 Button Page 0x7
§

Gamepad7

USB HID:

  • Button 8 Button Page 0x8
§

Gamepad8

USB HID:

  • Button 9 Button Page 0x9
§

Gamepad9

USB HID:

  • Button 10 Button Page 0xa
§

Gamepad10

USB HID:

  • Button 11 Button Page 0xb
§

Gamepad11

USB HID:

  • Button 12 Button Page 0xc
§

Gamepad12

USB HID:

  • Button 13 Button Page 0xd
§

Gamepad13

USB HID:

  • Button 14 Button Page 0xe
§

Gamepad14

USB HID:

  • Button 15 Button Page 0xf
§

Gamepad15

USB HID:

  • Button 16 Button Page 0x10
§

Gamepad16

USB HID:

  • Button 17 Button Page 0x11
§

Gamepad17

USB HID:

  • Button 18 Button Page 0x12
§

Gamepad18

USB HID:

  • Button 19 Button Page 0x13
§

Gamepad19

USB HID:

  • Button 20 Button Page 0x14
§

BrightnessDown

Non-standard code value supported by Chromium.

USB HID:

  • Display Brightness Decrement Consumer Page 0x70
§

BrightnessUp

Non-standard code value supported by Chromium.

USB HID:

  • Display Brightness Increment Consumer Page 0x6f
§

DisplayToggleIntExt

Non-standard code value supported by Chromium.

USB HID:

  • System Display Toggle Int/Ext Mode Generic Desktop Page 0xb5
§

KeyboardLayoutSelect

Non-standard code value supported by Chromium.

USB HID:

  • AC Next Keyboard Layout Select Consumer Page 0x29d
§

LaunchAssistant

Non-standard code value supported by Chromium.

USB HID:

  • AL Context-aware Desktop Assistant Consumer Page 0x1cb
§

LaunchControlPanel

Non-standard code value supported by Chromium.

USB HID:

  • AL Control Panel Consumer Page 0x19f
§

LaunchScreenSaver

Non-standard code value supported by Chromium.

USB HID:

  • AL Screen Saver Consumer Page 0x1b1
§

MailForward

Non-standard code value supported by Chromium.

USB HID:

  • AC Forward Msg Consumer Page 0x28b
§

MailReply

Non-standard code value supported by Chromium.

USB HID:

  • AC Reply Consumer Page 0x289
§

MailSend

Non-standard code value supported by Chromium.

USB HID:

  • AC Send Consumer Page 0x28c
§

MediaFastForward

Non-standard code value supported by Chromium.

USB HID:

  • Fast Forward Consumer Page 0xb3
§

MediaPlay

Non-standard code value supported by Chromium.

USB HID:

  • Play Consumer Page 0xb0
§

MediaPause

Non-standard code value supported by Chromium.

USB HID:

  • Pause Consumer Page 0xb1
§

MediaRecord

Non-standard code value supported by Chromium.

USB HID:

  • Record Consumer Page 0xb2
§

MediaRewind

Non-standard code value supported by Chromium.

USB HID:

  • Rewind Consumer Page 0xb4
§

MicrophoneMuteToggle

Non-standard code value supported by Chromium.

USB HID:

  • Phone Mute Telephony Device Page 0x2f
§

PrivacyScreenToggle

Non-standard code value supported by Chromium.

USB HID:

  • Privacy Screen Toggle Consumer Page 0x2d0
§

SelectTask

Non-standard code value supported by Chromium.

USB HID:

  • AL Select Task/Application Consumer Page 0x1a2
§

ShowAllWindows

Non-standard code value supported by Chromium.

USB HID:

  • AC Desktop Show All Windows Consumer Page 0x29f
§

ZoomToggle

Non-standard code value supported by Chromium.

USB HID:

  • AC View Toggle Consumer Page 0x232

Implementations§

Source§

impl KeyCode

Source

pub fn with_modifiers(self, modifiers: Modifiers) -> Hotkey

Combines the key code with the modifiers to form a Hotkey.

Source

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

Returns the name of the key code.

Source

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

Resolve the KeyCode according to the standard US layout.

Source

pub const fn classify(self) -> KeyCodeClass

Classifies a key based on its grouping on the Keyboard.

Source

pub fn resolve(self, hook: &Hook) -> Cow<'static, str>

Resolves the key according to the current keyboard layout.

Trait Implementations§

Source§

impl Clone for KeyCode

Source§

fn clone(&self) -> KeyCode

Returns a duplicate 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 KeyCode

Source§

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

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

impl<'de> Deserialize<'de> for KeyCode

Source§

fn deserialize<D>(deserializer: D) -> Result<Self, D::Error>
where D: Deserializer<'de>,

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

impl From<KeyCode> for Hotkey

Source§

fn from(key_code: KeyCode) -> Self

Converts to this type from the input type.
Source§

impl FromStr for KeyCode

Source§

type Err = ()

The associated error which can be returned from parsing.
Source§

fn from_str(s: &str) -> Result<Self, Self::Err>

Parses a string s to return a value of this type. Read more
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 PartialEq for KeyCode

Source§

fn eq(&self, other: &KeyCode) -> 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 Serialize for KeyCode

Source§

fn serialize<S>(&self, serializer: S) -> Result<S::Ok, S::Error>
where S: Serializer,

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

impl Copy for KeyCode

Source§

impl Eq for KeyCode

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

Source§

fn conv<T>(self) -> T
where Self: Into<T>,

Converts self into T using Into<T>. Read more
Source§

impl<T> FmtForward for T

Source§

fn fmt_binary(self) -> FmtBinary<Self>
where Self: Binary,

Causes self to use its Binary implementation when Debug-formatted.
Source§

fn fmt_display(self) -> FmtDisplay<Self>
where Self: Display,

Causes self to use its Display implementation when Debug-formatted.
Source§

fn fmt_lower_exp(self) -> FmtLowerExp<Self>
where Self: LowerExp,

Causes self to use its LowerExp implementation when Debug-formatted.
Source§

fn fmt_lower_hex(self) -> FmtLowerHex<Self>
where Self: LowerHex,

Causes self to use its LowerHex implementation when Debug-formatted.
Source§

fn fmt_octal(self) -> FmtOctal<Self>
where Self: Octal,

Causes self to use its Octal implementation when Debug-formatted.
Source§

fn fmt_pointer(self) -> FmtPointer<Self>
where Self: Pointer,

Causes self to use its Pointer implementation when Debug-formatted.
Source§

fn fmt_upper_exp(self) -> FmtUpperExp<Self>
where Self: UpperExp,

Causes self to use its UpperExp implementation when Debug-formatted.
Source§

fn fmt_upper_hex(self) -> FmtUpperHex<Self>
where Self: UpperHex,

Causes self to use its UpperHex implementation when Debug-formatted.
Source§

fn fmt_list(self) -> FmtList<Self>
where &'a Self: for<'a> IntoIterator,

Formats each item in a sequence. 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> Pipe for T
where T: ?Sized,

Source§

fn pipe<R>(self, func: impl FnOnce(Self) -> R) -> R
where Self: Sized,

Pipes by value. This is generally the method you want to use. Read more
Source§

fn pipe_ref<'a, R>(&'a self, func: impl FnOnce(&'a Self) -> R) -> R
where R: 'a,

Borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_ref_mut<'a, R>(&'a mut self, func: impl FnOnce(&'a mut Self) -> R) -> R
where R: 'a,

Mutably borrows self and passes that borrow into the pipe function. Read more
Source§

fn pipe_borrow<'a, B, R>(&'a self, func: impl FnOnce(&'a B) -> R) -> R
where Self: Borrow<B>, B: 'a + ?Sized, R: 'a,

Borrows self, then passes self.borrow() into the pipe function. Read more
Source§

fn pipe_borrow_mut<'a, B, R>( &'a mut self, func: impl FnOnce(&'a mut B) -> R, ) -> R
where Self: BorrowMut<B>, B: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.borrow_mut() into the pipe function. Read more
Source§

fn pipe_as_ref<'a, U, R>(&'a self, func: impl FnOnce(&'a U) -> R) -> R
where Self: AsRef<U>, U: 'a + ?Sized, R: 'a,

Borrows self, then passes self.as_ref() into the pipe function.
Source§

fn pipe_as_mut<'a, U, R>(&'a mut self, func: impl FnOnce(&'a mut U) -> R) -> R
where Self: AsMut<U>, U: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.as_mut() into the pipe function.
Source§

fn pipe_deref<'a, T, R>(&'a self, func: impl FnOnce(&'a T) -> R) -> R
where Self: Deref<Target = T>, T: 'a + ?Sized, R: 'a,

Borrows self, then passes self.deref() into the pipe function.
Source§

fn pipe_deref_mut<'a, T, R>( &'a mut self, func: impl FnOnce(&'a mut T) -> R, ) -> R
where Self: DerefMut<Target = T> + Deref, T: 'a + ?Sized, R: 'a,

Mutably borrows self, then passes self.deref_mut() into the pipe function.
Source§

impl<T> Tap for T

Source§

fn tap(self, func: impl FnOnce(&Self)) -> Self

Immutable access to a value. Read more
Source§

fn tap_mut(self, func: impl FnOnce(&mut Self)) -> Self

Mutable access to a value. Read more
Source§

fn tap_borrow<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Immutable access to the Borrow<B> of a value. Read more
Source§

fn tap_borrow_mut<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Mutable access to the BorrowMut<B> of a value. Read more
Source§

fn tap_ref<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Immutable access to the AsRef<R> view of a value. Read more
Source§

fn tap_ref_mut<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Mutable access to the AsMut<R> view of a value. Read more
Source§

fn tap_deref<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Immutable access to the Deref::Target of a value. Read more
Source§

fn tap_deref_mut<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Mutable access to the Deref::Target of a value. Read more
Source§

fn tap_dbg(self, func: impl FnOnce(&Self)) -> Self

Calls .tap() only in debug builds, and is erased in release builds.
Source§

fn tap_mut_dbg(self, func: impl FnOnce(&mut Self)) -> Self

Calls .tap_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_dbg<B>(self, func: impl FnOnce(&B)) -> Self
where Self: Borrow<B>, B: ?Sized,

Calls .tap_borrow() only in debug builds, and is erased in release builds.
Source§

fn tap_borrow_mut_dbg<B>(self, func: impl FnOnce(&mut B)) -> Self
where Self: BorrowMut<B>, B: ?Sized,

Calls .tap_borrow_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_dbg<R>(self, func: impl FnOnce(&R)) -> Self
where Self: AsRef<R>, R: ?Sized,

Calls .tap_ref() only in debug builds, and is erased in release builds.
Source§

fn tap_ref_mut_dbg<R>(self, func: impl FnOnce(&mut R)) -> Self
where Self: AsMut<R>, R: ?Sized,

Calls .tap_ref_mut() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_dbg<T>(self, func: impl FnOnce(&T)) -> Self
where Self: Deref<Target = T>, T: ?Sized,

Calls .tap_deref() only in debug builds, and is erased in release builds.
Source§

fn tap_deref_mut_dbg<T>(self, func: impl FnOnce(&mut T)) -> Self
where Self: DerefMut<Target = T> + Deref, T: ?Sized,

Calls .tap_deref_mut() only in debug builds, and is erased in release builds.
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> TryConv for T

Source§

fn try_conv<T>(self) -> Result<T, Self::Error>
where Self: TryInto<T>,

Attempts to convert self into T using TryInto<T>. 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.
Source§

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