Unity 6.3
0 онлайн 3 гостей 3 в системе
Вход

Event.command

Declaration

public bool command;

Описание

Удерживается ли клавишная комбинация Command/Windows? (только для чтения)

На Windows это возвращает true, если удерживается любая клавишная комбинация Windows.
На Mac это возвращает true, если удерживается любая клавишная комбинация Command.

using UnityEngine;

public class Example : MonoBehaviour { // Prints Command/Windows key was pressed depending on the // platform where this script is running. void OnGUI() { Event e = Event.current; if (e.command) { if (Application.platform == RuntimePlatform.OSXEditor) { Debug.Log("Command key was pressed"); } else if (Application.platform == RuntimePlatform.WindowsEditor) { Debug.Log("Windows Key was pressed!"); } } } }