键盘事件的原始键代码。
在 EventType.KeyDown 和 EventType.KeyUp 事件中使用;返回 KeyCode 值,
该值与此物理键盘键相匹配。使用它来处理光标键、
功能键等。
另请参阅:Event.character。
using UnityEngine;
using System.Collections;
public class ExampleClass : MonoBehaviour {
void OnGUI() {
Event e = Event.current;
if (e.isKey)
Debug.Log("Detected key code: " + e.keyCode);
}
}