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 Any Key Pressed#

Input / Is Any Key Pressed

  • Can Read

  • Cannot Write

Description#

Returns true if any Keyboard key is being held down

Code#

using System;
using UnityEngine.InputSystem;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Get]

    [Title("Is Any Key Pressed")]
    [Category("Input/Is Any Key Pressed")]

    [Description("Returns true if any Keyboard key is being held down")]
    [Image(typeof(IconKeyHold), ColorTheme.Type.Blue)]

    [Keywords("Button", "Down", "Every", "Some")]

    [Serializable]
    public class TypeBoolInputKeyboardAnyPress : TypeBool
    {
        public override bool Get(Args args)
        {
            Keyboard keyboard = Keyboard.current;
            return keyboard != null && keyboard.anyKey.isPressed;
        }

        public override string ToString()
        {
            return "Pressing any Key";
        }

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