文档

Unity Engine

Unity Engine

shift

Is Shift held down? (Read Only)
阅读时间1 分钟最后更新于 1 个月前

Definition

  • Type: Property
  • Namespace: UnityEngine
  • Assembly: UnityEngine.IMGUIModule
public bool shift { get; set; }

Remarks

Returns true if any Shift key is held down.

Examples

using UnityEngine;public class Example : MonoBehaviour{ // Detects if the shift key was pressed void OnGUI() { Event e = Event.current; if (e.shift) { Debug.Log("Shift was pressed :O"); } }}