> ## Documentation Index
> Fetch the complete documentation index at: https://lua.nlcrack.cc/llms.txt
> Use this file to discover all available pages before exploring further.

# Input

> Keyboard and mouse state.

## Functions

| Function | Returns | Description |
| - | - | - |
| `input.key_down(vk)` | `bool` | Key currently held |
| `input.key_pressed(vk)` | `bool` | Key just pressed this frame |
| `input.key_name(vk)` | `string` | Human-readable key name |
| `input.cursor()` | `x, y` | Mouse cursor position |
| `input.menu_open()` | `bool` | Whether the cheat menu is open |

Virtual key codes follow the Windows `VK_*` constants: `0x01` (LMB), `0x02` (RMB), `0x04` (MMB), `0x1B` (Escape), `0x20` (Space), `0x41`-`0x5A` (A-Z).

## Example

```lua theme={null} theme={null}
events.on('paint', function()
    if input.key_pressed(0x48) then -- H
        print('H pressed')
    end
end)
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.