---
tags:
    - "Button"
    - "Key"
    - "Down"
---

# Is Input Action Pressed

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

<div class="grid cards" markdown>

* :green_circle: Can Read

* :red_circle: Cannot Write

</div>

## Description

Returns true if the specified Input Action value is being held down

## Code

```cs
using System;
using UnityEngine;
using VisualScript.Icons;

namespace VisualScript.Runtime
{
    [Get]
    
    [Title("Is Input Action Pressed")]
    [Category("Input/Is Input Action Pressed")]
    
    [Description("Returns true if the specified Input Action value is being held down")]
    [Image(typeof(IconBoltOutline), ColorTheme.Type.Teal)]
    
    [Keywords("Button", "Key", "Down")]
    
    [Serializable]
    public class TypeBoolInputActionPress : TypeBool
    {
        [SerializeField] private InputActionFromAsset m_InputAction = new InputActionFromAsset();
        
        public override bool Get(Args args)
        {
            UnityEngine.InputSystem.InputAction inputAction = this.m_InputAction.InputAction;
            return inputAction?.IsPressed() ?? false;
        }

        public override string ToString()
        {
            return $"Pressing {this.m_InputAction}";
        }

        protected override SubscriptionMode Subscription => SubscriptionMode.OnChange;
    }
}
```

