> For the complete documentation index, see [llms.txt](https://docs.pasteware.team/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.pasteware.team/namespaces/input.md).

# input

{% hint style="info" %}
You can find a list of virtual key codes here: <https://docs.microsoft.com/en-us/windows/win32/inputdev/virtual-key-codes>
{% endhint %}

## is\_key\_down( vk ): bool

Returns if the key is being held down or not

| Type | Name | Description                            |
| ---- | ---- | -------------------------------------- |
| int  | vk   | The virtual key code you want to check |

```
if ( input.is_key_down( 0x01 ) ) {

}
```

## is\_key\_pressed( vk ): bool

Returns if the key was pressed or not

| Type | Name | Description                            |
| ---- | ---- | -------------------------------------- |
| int  | vk   | The virtual key code you want to check |

```
if ( input.is_key_pressed( 0x01 ) ) {

}
```

## is\_cursor\_in\_bounds( x0, y0, x1, y1 ): bool

Returns if the mouse cursor is inside the given bounds or not

| Type  | Name | Description                     |
| ----- | ---- | ------------------------------- |
| float | x0   | Starting position on the x axis |
| float | y0   | Starting position on the y axis |
| float | x1   | Ending position on the x axis   |
| float | y1   | Ending position on the y axis   |

```
if ( input.is_cursor_in_bounds( 0, 0, 1920, 1080 ) ) {

}
```

## get\_cursor\_pos(): vec2\_t

Returns the position of the mouse cursor

```
var cursor_pos = input.get_cursor_pos();
```
