Content-Length: 20101 | pFad | https://docs.unity3d.com/ScriptReference/../Manual/../ScriptReference/EventModifiers.CapsLock.html
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); } }
Fetched URL: https://docs.unity3d.com/ScriptReference/../Manual/../ScriptReference/EventModifiers.CapsLock.html
Alternative Proxies: