Event.control 键盘Ctrl键

var control : bool

Description描述

Is Control key held down? (Read Only)

Ctrl键被按住了么(只读)?

Returns true if any Control key is held down.

如果Ctrl键被按住返回真。

using UnityEngine;
using System.Collections;

public class example : MonoBehaviour {
	void OnGUI() {
		Event e = Event.current;
		if (e.control)
			Debug.Log("Control was pressed.");

	}
}
// Detects if the control key was pressed
//检测如果Ctrl键被按下
function OnGUI() {
	var e : Event = Event.current;
	if (e.control) {
		Debug.Log("Control was pressed.");
	}
}
最后修改:2010年12月31日 Friday 20:11

本脚本参考基于Unity 3.4.1f5

英文部分版权属©Unity公司所有,中文部分© Unity圣典 版权所有,未经许可,严禁转载 。