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.");
	}
}
Page last updated: 2010-12-31