> For the complete documentation index, see [llms.txt](https://zarzel.gitbook.io/zarscript2/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://zarzel.gitbook.io/zarscript2/documentation/api-libs/input.md).

# input

Keyboard and mouse functions

### input.is\_key\_down

```lua
input.is_key_down(key_code): boolean
```

| Argument  | Type   | Description               |
| --------- | ------ | ------------------------- |
| key\_code | Number | LWJGL 2 Key code to check |

Returns if the specified key is currently being pressed

Key codes can be found here: <https://minecraft.fandom.com/el/wiki/Key_codes>

### input.is\_mouse\_down

```lua
input.is_mouse_down(mouse_button): boolean
```

| Argument      | Type   | Description                        |
| ------------- | ------ | ---------------------------------- |
| mouse\_button | Number | LWJGL 2 mouse button code to check |

Returns if the specified mouse button is currently being pressed

### input.get\_key\_name

```lua
input.get_key_name(key_code): string
```

| Argument  | Type   | Description |
| --------- | ------ | ----------- |
| key\_code | Number | Key code    |

Returns the key name of a specified key code

### input.get\_key\_number

```lua
input.get_key_name(key_name): number
```

| Argument  | Type   | Description           |
| --------- | ------ | --------------------- |
| key\_name | String | Key name, such as "b" |

Returns the key code of the specified key name

### input.get\_scroll

```lua
input.get_scroll(): number
```

Returns the scrolled amount in mouse wheel
