Documentation index for AI agents (llms.txt) A Markdown version of every page is available: request the page's source under /docs/, follow the "alternate" link in this page's head, or start from /llms.txt.
Visual Script logo Manual

Is Cursor Locked#

Input / Is Cursor Locked

  • Can Read

  • Cannot Write

Description#

Returns true if the hardware cursor is confined to the center of the window

Code#

using System;
using UnityEngine;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Get]

    [Title("Is Cursor Locked")]
    [Category("Input/Is Cursor Locked")]

    [Description("Returns true if the hardware cursor is confined to the center of the window")]
    [Image(typeof(IconLockSolid), ColorTheme.Type.Blue)]

    [Keywords("Mouse", "Pointer", "Confined", "Free", "Lock")]

    [Serializable]
    public class TypeBoolInputCursorLocked : TypeBool
    {
        public override bool Get(Args args)
        {
            return UnityEngine.Cursor.lockState == CursorLockMode.Locked;
        }

        public override string ToString()
        {
            return "Cursor is Locked";
        }

        protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
    }
}
Visual Script logoVisual Script © Catsoft Works 2026. All rights reserved.