<!-- fivemad.com, Markdown source of https://fivemad.com/docs/tools/controls-reference -->
> Source: https://fivemad.com/docs/tools/controls-reference
> Section: Tools
> Tags: controls, IsControlJustPressed, DisableControlAction, RegisterKeyMapping, keybinds
> Tool: https://fivemad.com/tools/controls-reference
> Last updated: 2026-09-25
> Site map for assistants: https://fivemad.com/llms.txt

# Controls Reference

Find any GTA V control index by number, INPUT_ name or key, press a real key to see every control on it, and copy detect, disable or RegisterKeyMapping code.

The Controls Reference lists all 361 GTA V controls (index 0 to 360) with their `INPUT_` name, default keyboard key and default gamepad button. Press a key on your keyboard or controller to see every control bound to it, then copy a snippet to detect it, disable it, or replace it with your own key mapping.

Every snippet block on this page has a **Lua / JS / TS / C#** switcher in its corner. The choice is remembered across the site, and [the runtimes page](/docs/development/runtimes) explains what changes between them.

## What it is for

`IsControlJustPressed(0, 51)` means nothing until you know 51 is `INPUT_CONTEXT` on <kbd>E</kbd>. And <kbd>E</kbd> is also `INPUT_PICKUP`, `INPUT_TALK`, `INPUT_VEH_HORN` and more, depending on what the player is doing. This page answers "what index is that key" and "what else uses this key" before you pick one for your script.

## Quick start

1. Search by index (`51`), name (`CONTEXT`, `veh exit`) or key (`E`, `LEFT SHIFT`). Searching for a single letter or two looks up the key, not names.
2. Or click **Press a key to find it** and press the real key. Click **Stop listening** when done.
3. Click a row. The detail panel (right side on desktop, inline on phones) shows the bindings and snippets. Before you click anything it shows control 51.
4. Pick the **Input group**, a snippet tab, and copy the code.

## Filters

| Control | What it does |
| --- | --- |
| Search box | Index, `INPUT_` name, name words or key. Exact index and key matches rank first. |
| Group dropdown | On foot, Camera, Weapons, Melee, Vehicle, Aircraft, Submarine, Bicycle, Parachute, Phone, Frontend, Cursor & map, Script, Multiplayer, Replay editor, Creator. Each shows a count. |
| Device chips | **All**, **Keyboard / mouse** (has a keyboard default), **Gamepad only**, **No default**. |
| **Copy link** | Copies a link to the exact view. |

The list shows 80 rows at a time with a button to show more. Click the index or name to copy it, click a key chip to filter the list by that key.

## Key finder

The **Key finder** panel has a **Keyboard** and a **Gamepad** tab. Each key on the map shows how many controls use it (within the current group). Click a key to filter the list, and **Clear key** removes the filter.

With listening on:

- Any key press on the keyboard selects that key.
- A box appears where you can left click, right click, middle click or scroll to pick mouse buttons and the wheel.
- On the **Gamepad** tab, pressing a controller button or pushing a stick picks it. Browsers only see a controller after you press something on it, and controllers without the standard mapping may pick the wrong button.

## Detail panel

Shows the name, index, group, whether it is an axis, the keyboard and gamepad bindings, and the raw text from the FiveM docs.

**Input group (first argument)** switches the snippets between:

| Value | Name | Use it for |
| --- | --- | --- |
| `0` | PLAYER_CONTROL | Almost everything: on foot, driving, weapons. |
| `1` | CAMERA_CONTROL | Camera inputs, rarely needed. |
| `2` | FRONTEND_CONTROL | Menus and the pause screen. Still works while a frontend menu is open. |

### Snippet tabs

| Tab | What you get | File name |
| --- | --- | --- |
| **Detect** | A `Wait(0)` loop with `IsControlJustPressed`, `IsControlPressed` or `IsControlJustReleased` (buttons to switch). For axis controls the tab is called **Read** and uses `GetControlNormal`. | `control.lua` |
| **Disable** | `DisableControlAction` every frame plus an `IsDisabledControlJustPressed` check. | `disable_control.lua` |
| **Key mapping** | `+` and `-` commands with `RegisterKeyMapping`, using the control's default key. Set a **Command prefix** (default `myres`) and a **Settings label**. | `keymapping.lua` |

## Examples

Detecting <kbd>E</kbd> near something:

```lua title="control.lua"
CreateThread(function()
    while true do
        Wait(0)
        if IsControlJustPressed(0, 51) then -- INPUT_CONTEXT (E, pad DPAD RIGHT)
            -- your code here
        end
    end
end)
```

Blocking attacks in a safe zone:

```lua title="disable_control.lua"
CreateThread(function()
    while true do
        Wait(0)
        DisableControlAction(0, 24, true) -- INPUT_ATTACK
        if IsDisabledControlJustPressed(0, 24) then
            -- player tried to shoot
        end
    end
end)
```

A rebindable key for your own feature:

```lua title="keymapping.lua"
RegisterCommand("+myres_context", function()
    -- key pressed
end, false)

RegisterCommand("-myres_context", function()
    -- key released
end, false)

RegisterKeyMapping("+myres_context", "Open my menu", "keyboard", "E")
```

## Control index or RegisterKeyMapping?

- **Control indexes** are the game's own actions. Use them to react to or block vanilla input. If a player rebinds a GTA action, the index follows their key. They need a `Wait(0)` loop and you cannot give your feature its own key.
- **RegisterKeyMapping** adds an entry under Settings, Key Bindings, FiveM. Each player can change it, it is saved on their machine, and it needs no loop. Use it for anything your resource adds: menus, radios, emotes.

> [!WARNING]
> The default key of a mapping only applies the first time a player sees it. Changing it in your script later does not move existing players, so choose it carefully.

## Tips

- `DisableControlAction` lasts one frame. Call it every tick.
- While a control is disabled, `IsControlJustPressed` returns false. Use `IsDisabledControlJustPressed` or `IsDisabledControlPressed`.
- `DisableAllControlActions(0)` blocks the whole group; re-enable what you need with `EnableControlAction`.
- If a check does nothing while a pause menu or frontend is open, try input group `2`.

## Shareable links

The URL follows the page: `?q=` for the search, `?key=` for the selected key (`?key=E`, `?key=LSHIFT`, `?key=pad:DPAD RIGHT`) and `?id=` for the open control.

## Limitations

Keyboard keys are the QWERTY defaults and gamepad buttons use Xbox names, as the FiveM docs list them. A player's own bindings may differ. Everything runs in the browser, and key presses are only read while listening is on.

## Related tools

- [Draw Text Colors](/docs/tools/text-colors) (for `~INPUT_CONTEXT~` prompts)
- [Warning Screen Buttons](/docs/tools/warning-buttons)
- [Scaleform Functions](/docs/tools/scaleform-reference)
- [Sound Browser](/docs/tools/sound-browser)
