``).join(""))跳到主要内容

Key

搜索

枚举 Key 

源代码
pub enum Key {
Show 255 variants Num0, Num1, Num2, Num3, Num4, Num5, Num6, Num7, Num8, Num9, A, B, C, D, E, F, G, H, I, J, K, L, M, N, O, P, Q, R, S, T, U, V, W, X, Y, Z, AbntC1, AbntC2, Accept, Add, Alt, Apps, Attn, Backspace, BrowserBack, BrowserFavorites, BrowserForward, BrowserHome, BrowserRefresh, BrowserSearch, BrowserStop, Cancel, CapsLock, Clear, Command, Control, Convert, Crsel, DBEAlphanumeric, DBECodeinput, DBEDetermineString, DBEEnterDLGConversionMode, DBEEnterIMEConfigMode, DBEEnterWordRegisterMode, DBEFlushString, DBEHiragana, DBEKatakana, DBENoCodepoint, DBENoRoman, DBERoman, DBESBCSChar, DBESChar, Decimal, Delete, Divide, DownArrow, End, Ereof, Escape, Execute, Exsel, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, F13, F14, F15, F16, F17, F18, F19, F20, F21, F22, F23, F24, Final, GamepadA, GamepadB, GamepadDPadDown, GamepadDPadLeft, GamepadDPadRight, GamepadDPadUp, GamepadLeftShoulder, GamepadLeftThumbstickButton, GamepadLeftThumbstickDown, GamepadLeftThumbstickLeft, GamepadLeftThumbstickRight, GamepadLeftThumbstickUp, GamepadLeftTrigger, GamepadMenu, GamepadRightShoulder, GamepadRightThumbstickButton, GamepadRightThumbstickDown, GamepadRightThumbstickLeft, GamepadRightThumbstickRight, GamepadRightThumbstickUp, GamepadRightTrigger, GamepadView, GamepadX, GamepadY, Hangeul, Hangul, Hanja, Help, Home, Ico00, IcoClear, IcoHelp, IMEOff, IMEOn, Insert, Junja, Kana, Kanji, LaunchApp1, LaunchApp2, LaunchMail, LaunchMediaSelect, LButton, LControl, LeftArrow, LMenu, LShift, LWin, MButton, MediaNextTrack, MediaPlayPause, MediaPrevTrack, MediaStop, Meta, ModeChange, Multiply, NavigationAccept, NavigationCancel, NavigationDown, NavigationLeft, NavigationMenu, NavigationRight, NavigationUp, NavigationView, NoName, NonConvert, None, Numlock, Numpad0, Numpad1, Numpad2, Numpad3, Numpad4, Numpad5, Numpad6, Numpad7, Numpad8, Numpad9, OEM1, OEM102, OEM2, OEM3, OEM4, OEM5, OEM6, OEM7, OEM8, OEMAttn, OEMAuto, OEMAx, OEMBacktab, OEMClear, OEMComma, OEMCopy, OEMCusel, OEMEnlw, OEMFinish, OEMFJJisho, OEMFJLoya, OEMFJMasshou, OEMFJRoya, OEMFJTouroku, OEMJump, OEMMinus, OEMNECEqual, OEMPA1, OEMPA2, OEMPA3, OEMPeriod, OEMPlus, OEMReset, OEMWsctrl, Option, PA1, Packet, PageDown, PageUp, Pause, Play, Print, PrintScr, Processkey, RButton, RControl, Return, RightArrow, RMenu, RShift, RWin, Scroll, Select, Separator, Shift, Sleep, Snapshot, Space, Subtract, Super, Tab, UpArrow, VolumeDown, VolumeMute, VolumeUp, Windows, XButton1, XButton2, Zoom, Unicode(char), Other(u32),
}
展开描述

包含所有可用的按键码。 使用 Key::Unicode 输入任意 Unicode 字符。 如果缺少某个按键,请在我们的仓库中提交 issue,我们会尽快添加。同时,你可以通过 Key::Othercrate::Keyboard::raw 函数模拟该按键。某些按键仅在特定平台上可用,请使用条件编译来使用它们。

变体§

§

Num0

§

Num1

§

Num2

§

Num3

§

Num4

§

Num5

§

Num6

§

Num7

§

Num8

§

Num9

§

A

§

B

§

C

§

D

§

E

§

F

§

G

§

H

§

I

§

J

§

K

§

L

§

M

§

N

§

O

§

P

§

Q

§

R

§

S

§

T

§

U

§

V

§

W

§

X

§

Y

§

Z

§

AbntC1

§

AbntC2

§

Accept

§

Add

§

Alt

Linux 和 Windows 上的 Alt 键(macOS 上的 Option 键)

§

Apps

§

Attn

§

Backspace

退格键(Backspace)

§

BrowserBack

§

BrowserFavorites

§

BrowserForward

§

BrowserHome

§

BrowserRefresh

§

BrowserSearch

§

BrowserStop

§

Cancel

§

CapsLock

大写锁定键(CapsLock)

§

Clear

§

Command

👎Deprecated since 0.0.12: now renamed to Meta

macOS 上的 Command 键(Linux 上的 Super 键,Windows 上的 Windows 键)

§

Control

控制键(Control)

§

Convert

§

Crsel

§

DBEAlphanumeric

§

DBECodeinput

§

DBEDetermineString

§

DBEEnterDLGConversionMode

§

DBEEnterIMEConfigMode

§

DBEEnterWordRegisterMode

§

DBEFlushString

§

DBEHiragana

§

DBEKatakana

§

DBENoCodepoint

§

DBENoRoman

§

DBERoman

§

DBESBCSChar

§

DBESChar

§

Decimal

§

Delete

删除键(Delete)

§

Divide

§

DownArrow

下方向键

§

End

End 键

§

Ereof

§

Escape

退出键(Esc)

§

Execute

§

Exsel

§

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 键

§

Final

§

GamepadA

§

GamepadB

§

GamepadDPadDown

§

GamepadDPadLeft

§

GamepadDPadRight

§

GamepadDPadUp

§

GamepadLeftShoulder

§

GamepadLeftThumbstickButton

§

GamepadLeftThumbstickDown

§

GamepadLeftThumbstickLeft

§

GamepadLeftThumbstickRight

§

GamepadLeftThumbstickUp

§

GamepadLeftTrigger

§

GamepadMenu

§

GamepadRightShoulder

§

GamepadRightThumbstickButton

§

GamepadRightThumbstickDown

§

GamepadRightThumbstickLeft

§

GamepadRightThumbstickRight

§

GamepadRightThumbstickUp

§

GamepadRightTrigger

§

GamepadView

§

GamepadX

§

GamepadY

§

Hangeul

§

Hangul

§

Hanja

§

Help

§

Home

Home 键

§

Ico00

§

IcoClear

§

IcoHelp

§

IMEOff

§

IMEOn

§

Insert

§

Junja

§

Kana

§

Kanji

§

LaunchApp1

§

LaunchApp2

§

LaunchMail

§

LaunchMediaSelect

§

LButton

§

LControl

§

LeftArrow

左方向键

§

LMenu

§

LShift

§

LWin

§

MButton

§

MediaNextTrack

§

MediaPlayPause

§

MediaPrevTrack

§

MediaStop

§

Meta

Meta 键(也称为"windows"、"super"和"command")

§

ModeChange

§

Multiply

§

NavigationAccept

§

NavigationCancel

§

NavigationDown

§

NavigationLeft

§

NavigationMenu

§

NavigationRight

§

NavigationUp

§

NavigationView

§

NoName

§

NonConvert

§

None

§

Numlock

§

Numpad0

§

Numpad1

§

Numpad2

§

Numpad3

§

Numpad4

§

Numpad5

§

Numpad6

§

Numpad7

§

Numpad8

§

Numpad9

§

OEM1

§

OEM102

§

OEM2

§

OEM3

§

OEM4

§

OEM5

§

OEM6

§

OEM7

§

OEM8

§

OEMAttn

§

OEMAuto

§

OEMAx

§

OEMBacktab

§

OEMClear

§

OEMComma

§

OEMCopy

§

OEMCusel

§

OEMEnlw

§

OEMFinish

§

OEMFJJisho

§

OEMFJLoya

§

OEMFJMasshou

§

OEMFJRoya

§

OEMFJTouroku

§

OEMJump

§

OEMMinus

§

OEMNECEqual

§

OEMPA1

§

OEMPA2

§

OEMPA3

§

OEMPeriod

§

OEMPlus

§

OEMReset

§

OEMWsctrl

§

Option

macOS 上的 Option 键(Linux 和 Windows 上的 Alt 键)

§

PA1

§

Packet

§

PageDown

向下翻页键(PageDown)

§

PageUp

向上翻页键(PageUp)

§

Pause

§

Play

§

Print

👎Deprecated since 0.2.2: now renamed to PrintScr
§

PrintScr

截屏键(PrintScreen)

§

Processkey

§

RButton

§

RControl

§

Return

回车键(Return)

§

RightArrow

右方向键

§

RMenu

§

RShift

§

RWin

§

Scroll

§

Select

§

Separator

§

Shift

Shift 键

§

Sleep

§

Snapshot

👎Deprecated since 0.2.2: now renamed to PrintScr
§

Space

空格键

§

Subtract

§

Super

👎Deprecated since 0.0.12: now renamed to Meta

Linux 上的 Super 键(macOS 上的 Command 键,Windows 上的 Windows 键)

§

Tab

Tab 键(制表符)

§

UpArrow

上方向键

§

VolumeDown

§

VolumeMute

§

VolumeUp

§

Windows

👎Deprecated since 0.0.12: now renamed to Meta

Windows 上的 Windows 键(Linux 上的 Super 键,macOS 上的 Command 键)

§

XButton1

§

XButton2

§

Zoom

§

Unicode(char)

Unicode 字符

§

Other(u32)

对于此处未列出但你已知其取值的按键,请使用此项。如果你认为某个按键应该被列出,请告知我们,我们会尽快添加。 在 Linux 上将得到一个 keysym, 在 Windows 上将得到一个 Virtual_Key, 在 macOS 上将产生一个 KeyCode

trait 实现§

源代码§

impl Clone for Key

源代码§

fn clone(&self) -> Key

Returns a duplicate of the value. 阅读更多
1.0.0 · 源代码§

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

Performs copy-assignment from source. 阅读更多
源代码§

impl Debug for Key

源代码§

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

使用给定的格式化器格式化该值。 阅读更多
源代码§

impl Hash for Key

源代码§

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

Feeds this value into the given Hasher. 阅读更多
1.3.0 · 源代码§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. 阅读更多
源代码§

impl PartialEq for Key

源代码§

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

Tests for self and other values to be equal, and is used by ==.
1.0.0 · 源代码§

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

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
源代码§

impl TryFrom<Key> for VIRTUAL_KEY

仅在 Windows 上可用。

将 Key 转换为 Virtual Key

源代码§

type Error = &'static str

转换出错时返回的类型。
源代码§

fn try_from(key: Key) -> Result<Self, Self::Error>

执行该转换。
源代码§

impl Copy for Key

源代码§

impl Eq for Key

源代码§

impl StructuralPartialEq for Key

自动 trait 实现§

§

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 实现§

源代码§

impl<T> Any for T
where T: 'static + ?Sized,

源代码§

fn type_id(&self) -> TypeId

获取 selfTypeId阅读更多
源代码§

impl<T> Borrow<T> for T
where T: ?Sized,

源代码§

fn borrow(&self) -> &T

从拥有的值不可变地借用。 阅读更多
源代码§

impl<T> BorrowMut<T> for T
where T: ?Sized,

源代码§

fn borrow_mut(&mut self) -> &mut T

从拥有的值可变地借用。 阅读更多
源代码§

impl<T> CloneToUninit for T
where T: Clone,

源代码§

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. 阅读更多
源代码§

impl<T> From<T> for T

源代码§

fn from(t: T) -> T

原样返回参数。

源代码§

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

源代码§

fn into(self) -> U

调用 U::from(self)

也就是说,此转换是 From<T> for U 实现选择执行的操作。

源代码§

impl<T> ToOwned for T
where T: Clone,

源代码§

type Owned = T

The resulting type after obtaining ownership.
源代码§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. 阅读更多
源代码§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. 阅读更多
源代码§

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

源代码§

type Error = Infallible

转换出错时返回的类型。
源代码§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

执行该转换。
源代码§

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

源代码§

type Error = <U as TryFrom<T>>::Error

转换出错时返回的类型。
源代码§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

执行该转换。