Event.shift

Unity · Версия 2020.3 LTS · Scripting · Event

Event.shift

public bool shift;

Описание

Удерживается ли Shift? (Только чтение)

Возвращает true, если удерживается любая клавиша Shift.

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");
        }
    }
}

Обновлено 17 ноября 2026 г.