URL: https://docs.unity3d.com/ScriptReference/../Manual/../ScriptReference/EventModifiers.CapsLock.html
ataLayer-initialized', user: { user_unity_id: undefined, user_logged_in: 'no' }, environment: { environment_locale: 'en-us', environment_currency: undefined }});Is Caps Lock on?
Additional resources: Event.capsLock.
using UnityEngine; using UnityEngine.UIElements;
[RequireComponent(typeof(UIDocument))] public class Example : MonoBehaviour { // Prints CapsLock on/off depending on the state of the capslock key.
void OnEnable() { var textField = new TextField(); textField.RegisterCallback<KeyDownEvent>(e => { if ((e.modifiers & EventModifiers.CapsLock) != 0) { Debug.Log("CapsLock on."); } else { Debug.Log("CapsLock off."); } }, TrickleDown.TrickleDown); GetComponent<UIDocument>().rootVisualElement.Add(textField); } }