当前按键是否为功能键?(只读)
如果当前按键为箭头键、Page Up、Page Down、退格键等键,则返回 true。如果此键需要特殊处理才能在文本编辑中工作,则 functionKey
为开启状态。
using UnityEngine;
public class Example : MonoBehaviour { // Detects if a function Key was pressed if a // function key was pressed, prints its key code. void OnGUI() { Event e = Event.current; if (e.functionKey) { Debug.Log("Pressed: " + e.keyCode); } } }