Unity键值(KeyCode)Unity的Input管理
keyCode⽰例
keyCode Demo
function OnGUI(){
var e:Event=Event.current;
if(e.isKey){
Debug.Log("key:"+e.keyCode);
}
}
按钮检测结果
Unity键值对应表
KeyCode是由Event.keyCode返回的。这些直接映射到键盘上的物理键,以下是键值对应列表: 常⽤键
Backspace 退格键湿地科学
Delete Delete键
TabTab键
街角社会Clear Clear键
Return 回车键
Pau 暂停键
Escape ESC键
Space 空格键
⼩键盘
Keypad0 ⼩键盘0
Keypad1 ⼩键盘1
Keypad2 ⼩键盘2
Keypad3 ⼩键盘3
Keypad4 ⼩键盘4
Keypad5 ⼩键盘5
Keypad6 ⼩键盘6
Keypad7 ⼩键盘7
Keypad8 ⼩键盘8
Keypad9 ⼩键盘9
KeypadPeriod ⼩键盘“.”
KeypadDivide ⼩键盘“/”
KeypadMultiply⼩键盘“*”
KeypadMinus ⼩键盘“-”
KeypadPlus ⼩键盘“+”
KeypadEnter ⼩键盘“Enter”
KeypadEquals ⼩键盘“=”
功能键
UpArrow ⽅向键上 DownArrow ⽅向键下 RightArrow ⽅向键右 LeftArrow ⽅向键左 Inrt Inrt键
Home Home键
幼儿园老师辞职信EndEnd键
PageUp PageUp键 PageDown PageDown键 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
Alpha0 按键0
Alpha1 按键1
Alpha2 按键2
Alpha3 按键3
Alpha4 按键4
Alpha5 按键5
Alpha6 按键6
Alpha7 按键7
Alpha8 按键7
Alpha9 按键9
symple(符号键)
Exclaim ‘!’键 DoubleQuote双引号键 Hash Hash键
Dollar ‘$’键 AmpersandAmpersand键 Quote 单引号键
LeftParen 左括号键 RightParen右括号键 Asterisk ‘ * ’键
Plus ‘ + ’键
Comma ‘ , ’键
香港大学研究生院Minus ‘ - ’键
Period ‘ . ’键
Slash ‘ / ’键
Colon ‘ : ’键
Semicolon‘ ; ’键
Less ‘ < ‘键
Equals ‘ = ‘键
Greater ‘ > ‘键 Question ‘ ? ’键
At ‘@’键
LeftBracket‘ [ ‘键 Backslash ‘ \ ’键 RightBracket‘ ] ’键 Caret ‘ ^ ’键 Underscore‘ _ ’键 BackQuote‘ ` ’键
26个字母
A ‘a’键
B ‘b’键
C ‘c’键
D ‘d’键
E ‘e’键
F ‘f’键
小偷英文G ‘g’键
H ‘h’键
I ‘i’键
J ‘j’键
K ‘k’键
L ‘l’键
工作压力大怎么办M ‘m’键
N ‘n’键
O ‘o’键
穿新衣P ‘p’键
Q ‘q’键
R ‘r’键
S ‘s’键
T ‘t’键
U ‘u’键
V ‘v’键
W ‘w’键
X ‘x’键
Y ‘y’键
Z ‘z’键
键盘按键
Numlock Numlock键 Capslock ⼤⼩写锁定键 ScrollLockScroll Lock键 RightShift 右上档键
LeftShift 左上档键 RightControl右Ctrl键 LeftControl左Ctrl键
RightAlt 右Alt键
LeftAlt 左Alt键
LeftApple 左Apple键 LeftWindows左Windows键 RightApple右Apple键 RightWindows右Windows键 AltGr Alt Gr键
Help Help键
Print Print键
SysReq Sys Req键
Break Break键
Mou(⿏标)
Mou0 ⿏标左键
Mou1 ⿏标右键
Mou2 ⿏标中键
Mou3 ⿏标第3个按键
Mou4 ⿏标第4个按键
Mou5 ⿏标第5个按键
Mou6 ⿏标第6个按键
JoystickButton(⼿柄)
王子伊JoystickButton0⼿柄按键0 JoystickButton1⼿柄按键1 JoystickButton2⼿柄按键2 JoystickButton3⼿柄按键3 JoystickButton4⼿柄按键4 JoystickButton5⼿柄按键5 JoystickButton6⼿柄按键6 JoystickButton7⼿柄按键7 JoystickButton8⼿柄按键8 JoystickButton9⼿柄按键9 JoystickButton10⼿柄按键10 JoystickButton11⼿柄按键11 JoystickButton12⼿柄按键12 JoystickButton13⼿柄按键13 Jo
ystickButton14⼿柄按键14 JoystickButton15⼿柄按键15 JoystickButton16⼿柄按键16 JoystickButton17⼿柄按键17 JoystickButton18⼿柄按键18 JoystickButton19⼿柄按键19 Joystick1Button0第⼀个⼿柄按键0 Joystick1Button1第⼀个⼿柄按键1 Joystick1Button2第⼀个⼿柄按键2 Joystick1Button3第⼀个⼿柄按键3 Joystick1Button4第⼀个⼿柄按键4 Joystick1Button5第⼀个⼿柄按键5 Joystick1Button6第⼀个⼿柄按键6 Joystick1Button7第⼀个⼿柄按键7 Joystick1Button8第⼀个⼿柄按键8 Joystick1Button9第⼀个⼿柄按键9 Joystick1Button10第⼀个⼿柄按键10 Joystick1Button11第⼀个⼿柄按键11 Joystick1Button12第⼀个⼿柄按键12 Joystick1Button13第⼀个⼿柄按键13 Joystick1Button14第⼀个⼿柄按键14 Joystick1Button15第⼀个⼿柄按键15 Joystick1Button16第⼀个⼿柄按键16 Joystick1Button17第⼀个⼿柄按键17 Joystick1Button18第⼀个⼿柄按键18 Joystick1Button19第⼀个⼿柄按键19 Joystick2Button0第⼆个⼿柄按键0 Joystick2Button1第⼆个⼿柄按键1 Joystick2Button2第⼆个⼿柄按键2 Joystick2Button3第⼆个⼿柄按键3 Joystick2Button4第⼆个⼿柄按键4 Joystick2Button5第⼆个⼿柄按键5