> ## Documentation Index
> Fetch the complete documentation index at: https://mintlify.com/godotengine/godot/llms.txt
> Use this file to discover all available pages before exploring further.

# InputEvent

# InputEvent

**Inherits:** Resource \< RefCounted \< Object

## Description

Abstract base class for input events. All types of input events inherit from this class.

## Properties

<ResponseField name="device" type="int" default="0">
  The event's device ID.
</ResponseField>

## Methods

### is\_action\_pressed

```gdscript theme={null}
bool is_action_pressed(action: StringName, allow_echo: bool = false, exact_match: bool = false)
```

Returns true if the given action matches this event and is being pressed.

### is\_action\_released

```gdscript theme={null}
bool is_action_released(action: StringName, exact_match: bool = false)
```

Returns true if the given action matches this event and is released.

### is\_pressed

```gdscript theme={null}
bool is_pressed()
```

Returns true if this input event is pressed.

### is\_echo

```gdscript theme={null}
bool is_echo()
```

Returns true if this input event is an echo event (for key events).

### as\_text

```gdscript theme={null}
String as_text()
```

Returns a String representation of the event.

## Example Usage

<Tabs>
  <Tab title="GDScript">
    ```gdscript theme={null}
    func _input(event):
        if event.is_action_pressed("ui_accept"):
            print("Accept pressed")
        
        if event is InputEventKey:
            if event.is_pressed() and not event.is_echo():
                print("Key pressed: ", event.as_text())
    ```
  </Tab>

  <Tab title="C#">
    ```csharp theme={null}
    public override void _Input(InputEvent @event)
    {
        if (@event.IsActionPressed("ui_accept"))
        {
            GD.Print("Accept pressed");
        }
    }
    ```
  </Tab>
</Tabs>
