Event.functionKey 功能键

var functionKey : bool

Description描述

Is the current keypress a function key? (Read Only)

当前按下一个功能键?(只读)

Returns true if the current keypress is an arrow key, page up, page down, backspace, etc. key. If this key needs special processing in order to work in text editing, functionKey is on.

如果当前按下一个方向键、翻页键、回退键等,返回真。如果这个键需要特殊处理,为了文本编辑,functionKey需要打开。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	void OnGUI() {
		Event e = Event.current;
		if (e.functionKey)
			Debug.Log("Pressed: " + e.keyCode);

	}
}
// Detects if a function Key was pressed if a
// function key was pressed, prints its key code.
//检测如果一个功能键被按下,打印键码
function OnGUI() {
	var e : Event = Event.current;
	if (e.functionKey){
		Debug.Log("Pressed: " + e.keyCode);
	}
}
Page last updated: 2010-12-31