[−][src]Enum winput::Vk
A list of all available Virtual-Key Codes.
The official definition can be found here.
Variants
Left mouse button
VK_LBUTTON = 0x01
Right mouse button
VK_RBUTTON = 0x02
Control-break processing
CANCEL = 0x03
Middle mouse button (three-button mouse)
VK_MBUTTON = 0x04
X1 mouse button
VK_XBUTTON1 = 0x05
X2 mouse button
VK_XBUTTON1 = 0x06
BACKSPACE key
VK_BACK = 0x08
TAB key
VK_TAB = 0x09
CLEAR key
VK_CLEAR = 0x0c
ENTER key
VK_RETURN = 0x0d
SHIFT key
VK_SHIFT = 0x10
CTRL key
VK_CONTROL = 0x11
ALT key
VK_MENU = 0x12
PAUSE key
VK_PAUSE = 0x13
CAPS LOCK key
VK_CAPITAL = 0x14
IME Kana mode & IME Hangul mode
VK_KANA = VK_HANGUL = 0x15
IME On
VK_IME_ON = 0x16
IME Junja mode
VK_JUNJA = 0x17
IME final mode
VK_FINAL = 0x18
IME Kanji mode & IME Hanja mode
VK_KANJI = VK_HANJA = 0x19
IME Off
VK_Ime = 0x1a
ESC key
VK_ESCAPE = 0x1b
IME convert
VK_CONVERT = 0x1c
IME nonconvert
VK_NONCONVERT = 0x1d
IME accept
VK_ACCEPT = 0x1e
IME mode change request
VK_MODECHANGE = 0x1f
SPACEBAR
VK_SPACE = 0x20
PAGE UP key
VK_PRIOR = 0x21
PAGE DOWN key
VK_NEXT = 0x22
END key
VK_END = 0x23
HOME key
VK_HOME = 0x24
LEFT ARROW key
VK_LEFT = 0x25,
UP ARROW key
VK_UP = 0x26
RIGHT ARROW key
VK_RIGHT = 0x27
DOWN ARROW key
VK_DOWN = 0x28
SELECT key
VK_SELECT = 0x29
PRINT key
VK_PRINT = 0x2a
EXECUTE key
VK_EXECUTE = 0x2b
PRINT SCREEN key
VK_SNAPSHOT = 0x2c
INS key
VK_INSERT = 0x2d
DEL key
VK_DELETE = 0x2e
HELP key
VK_HELP = 0x2f,
0 key
1 key
2 key
3 key
4 key
5 key
6 key
7 key
8 key
9 key
A key
B key
C key
D key
E key
F key
G key
H key
I key
J key
K key
L key
M key
N key
O key
P key
Q key
R key
S key
T key
U key
V key
W key
X key
Y key
Z key
Left Windows key (Natural keyboard)
VK_LWIN = 0x5b,
Right Windows key (Natural keyboard)
VK_RWIN = 0x5c
Applications key (Natural keyboard)
VK_APPS = 0x5d
Computer Sleep key
VK_SLEEP = 0x5f
Numeric keypad 0 key
VK_NUMPAD0 = 0x60
Numeric keypad 1 key
VK_NUMPAD1 = 0x61
Numeric keypad 2 key
VK_NUMPAD2 = 0x62
Numeric keypad 3 key
VK_NUMPAD3 = 0x63
Numeric keypad 4 key
VK_NUMPAD4 = 0x64
Numeric keypad 5 key
VK_NUMPAD5 = 0x65
Numeric keypad 6 key
VK_NUMPAD6 = 0x66
Numeric keypad 7 key
VK_NUMPAD7 = 0x67
Numeric keyapd 8 key
VK_NUMPAD8 = 0x68
Numeric keypad 9 key
VK_NUMPAD9 = 0x69
Multiply key
VK_MULTIPLY = 0x6a
Add key
VK_ADD = 0x6b,
Separator key
VK_SEPARATOR = 0x6c,
Subtract key
VK_SUBTRACT = 0x6d
Decimal key
VK_DECIMAL = 0x6e
Divide key
VK_DIVIDE = 0x6f
F1 key
VK_F1 = 0x70
F2 key
VK_F2 = 0x71
F3 key
VK_F3 = 0x72
F4 key
VK_F4 = 0x73
F5 key
VK_F5 = 0x74
F6 key
VK_F6 = 0x75
F7 key
VK_F7 = 0x76
F8 key
VK_F8 = 0x77,
F9 key
VK_F9 = 0x78,
F10 key
VK_F10 = 0x79,
F11 key
VK_F11 = 0x7a
F12 key
VK_F12 = 0x7b
F13 key
VK_F13 = 0x7c
F14 key
VK_F14 = 0x7d
F15 key
VK_F15 = 0x7e
F16 key
VK_F16 = 0x7f
F17 key
VK_F17 = 0x80
F18 key
VK_F18 = 0x81,
F19 key
VK_F19 = 0x82,
F20 key
VK_F20 = 0x83,
F21 key
VK_F21 = 0x84,
F22 key
VK_F22 = 0x85,
F23 key
VK_F23 = 0x86,
F24 key
VK_F24 = 0x87,
NUM LOCK key
VK_NUMLOCK = 0x90
SCROLL LOCK key
VK_SCROLL = 0x91
Left SHIFT key
VK_LSHIFT = 0xa0
Right SHIFT key
VK_RSHIFT = 0xa1
Left CONTROL key
VK_LCONTROL = 0xa2
Right CONTROL key
VK_RCONTROL = 0xa3
Left MENU key
VK_LMENU = 0xa4
Right MENU key
VK_RMENU = 0xa5
Browser Back key
VK_BROWSER_BACK = 0xa6
Browser Forward key
VK_BROWSER_FORWARD = 0xa7
Browser Refresh key
VK_BROWSER_REFRESH = 0xa8
Browser Stop key
VK_BROWSER_STOP = 0xa9
Browser Search key
VK_BROWSER_SEARCH = 0xaa
Browser Favorites key
VK_BROWSER_FAVORITES = 0xab
Browser Start and Home key
VK_BROWSER_HOME = 0xac
Volume Mute key
VK_VOLUME_MUTE = 0xad
Volume Down key
VK_VOLUME_DOWN = 0xae
Volume Up key
VK_VOLUME_UP = 0xaf
Next Track key
VK_MEDIA_NEXT_TRACK = 0xb0
Prev Track key
VK_MEDIA_PREV_TRACK = 0xb1
Stop Media key
VK_MEDIA_STOP = 0xb2
Play/Pause Media key
VK_MEDIA_PLAY_PAUSE = 0xb3
Start Mail key
VK_LAUNCH_MAIL = 0xb4
Select Media key
VK_LAUNCH_MEDIA_SELECT = 0xb5
Start Application 1 key
VK_LAUNCH_APP1 = 0xb6
Start Application 2 key
VK_LAUNCH_APP2 = 0xb7
Used for miscellaneous characters; it can vary by keyboard. For the US standard
keyboard, the ;:
key.
VK_OEM_1 = 0xba
For any country/region, the +
key.
VK_OEM_PLUS = 0xbb
For any country/region, the ,
key.
VK_OEM_COMMA = 0xbc
For any country/region, the -
key.
VK_OEM_MINUS = 0xbd
For any country/region, the .
key.
VK_OEM_PERIOD = 0xbe
Used for miscellaneous characters; it can vary by keyboard. For the US standard
keyboard, the \?
key.
VK_OEM_2 = 0xbf
Used for miscellaneous characters; it can vary by keyboard. For the US standard keyboard, the ``~` key.
VK_OEM_3 = 0xc0
Used for miscellaneous characters; it can vary by keyboard. For the US standard
keyboard, the [{
key.
VK_OEM_4 = 0xdb
Used for miscellaneous characters; it can vary by keyboard. For the US standard
keyboard, the \|
key.
VK_OEM_5 = 0xdc
Used for miscellaneous characters; it can vary by keyboard. For the US standard
keyboard, the ]}
key.
VK_OEM_6 = 0xdd
Used for miscellaneous characters; it can vary by keyboard. For the US standard
keyboard, the '"
key.
VK_OEM_7 = 0xde
Used for miscellaneous characters; it can vary by keyboard.
VK_OEM_8 = 0xdd
Either the angle bracket key or the backslash key on the RT 102-key keyboard.
VK_OEM_102 = 0xe2
IME PROCESS key
VK_PROCESSKEY = 0xe5
Attn key
VK_ATTN = 0xf6
CrSel key
VK_CRSEL = 0xf7
ExSel key
VK_EXSEL = 0xf8
Erase EOF key
VK_EREOR = 0xf9
Play key
VK_PLAY = 0xfa
Zoom key
VK_ZOOM = 0xfb
PA1 key
VK_PA1 = 0xfd
Clear key
VK_OEM_CLEAR = 0xfe
Implementations
impl Vk
[src]
pub unsafe fn from_u8(n: u8) -> Self
[src]
Creates a Virtual-Key Code from the given u8
.
Safety
This function is safe as long as the given number n
is a valid Virtual-Key Code.
Providing a invalid number is undefined behaviour.
Example
use winput::Vk; // SAFETY: `0x0d` is a valid Virtual-Key Code. let vk = unsafe { Vk::from_u8(0x0d) }; assert_eq!(vk, Vk::Enter);
A safe way to use this function is to convert a Virtual-Key Code into a number.
use winput::Vk; let n = Vk::Escape.into(); // SAFETY: `n` is a valid Virtual-Key Code. let vk = unsafe { Vk::from_u8(n) }; assert_eq!(vk, Vk::Escape);
pub fn is_down(self) -> bool
[src]
Checks if this Virtual-Key Code is currently being pressed.
Example
use winput::Vk; if Vk::Z.is_down() { println!("The Z key is down!"); } else { println!("The Z key is not down :("); }
Trait Implementations
impl Clone for Vk
[src]
impl Copy for Vk
[src]
impl Debug for Vk
[src]
impl Eq for Vk
[src]
impl From<Vk> for u8
[src]
impl From<Vk> for u16
[src]
impl From<Vk> for u32
[src]
impl From<Vk> for u64
[src]
impl From<Vk> for u128
[src]
impl From<Vk> for i8
[src]
impl From<Vk> for i16
[src]
impl From<Vk> for i32
[src]
impl From<Vk> for i64
[src]
impl From<Vk> for i128
[src]
impl Hash for Vk
[src]
pub fn hash<__H: Hasher>(&self, state: &mut __H)
[src]
pub fn hash_slice<H>(data: &[Self], state: &mut H) where
H: Hasher,
1.3.0[src]
H: Hasher,
impl Keylike for Vk
[src]
pub fn produce_input(self, action: Action) -> Input
[src]
pub fn press(self) -> Result<(), WindowsError>
[src]
pub fn release(self) -> Result<(), WindowsError>
[src]
pub fn send(self) -> Result<(), WindowsError>
[src]
impl PartialEq<Vk> for Vk
[src]
impl StructuralEq for Vk
[src]
impl StructuralPartialEq for Vk
[src]
Auto Trait Implementations
impl RefUnwindSafe for Vk
[src]
impl Send for Vk
[src]
impl Sync for Vk
[src]
impl Unpin for Vk
[src]
impl UnwindSafe for Vk
[src]
Blanket Implementations
impl<T> Any for T where
T: 'static + ?Sized,
[src]
T: 'static + ?Sized,
impl<T> Borrow<T> for T where
T: ?Sized,
[src]
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
[src]
T: ?Sized,
pub fn borrow_mut(&mut self) -> &mut T
[src]
impl<T> From<T> for T
[src]
impl<T, U> Into<U> for T where
U: From<T>,
[src]
U: From<T>,
impl<T> ToOwned for T where
T: Clone,
[src]
T: Clone,
type Owned = T
The resulting type after obtaining ownership.
pub fn to_owned(&self) -> T
[src]
pub fn clone_into(&self, target: &mut T)
[src]
impl<T, U> TryFrom<U> for T where
U: Into<T>,
[src]
U: Into<T>,
type Error = Infallible
The type returned in the event of a conversion error.
pub fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>
[src]
impl<T, U> TryInto<U> for T where
U: TryFrom<T>,
[src]
U: TryFrom<T>,