---
tags:
    - "Button"
    - "Down"
    - "Every"
    - "Some"
---

# Is Any Key Pressed

[Input](index.md) / **Is Any Key Pressed**

<div class="grid cards" markdown>

* :green_circle: Can Read

* :red_circle: Cannot Write

</div>

## Description

Returns true if any Keyboard key is being held down

## Code

```cs
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;
    }
}

```

