> For the complete documentation index, see [llms.txt](https://grootdev.gitbook.io/groot-development/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://grootdev.gitbook.io/groot-development/coding-information/register-key-mapping.md).

# Register Key Mapping

{% hint style="warning" %}
There is no way to mass unbind keys for all of your server's players.
{% endhint %}

We've begun utilizing the FiveM native <mark style="color:red;">`RegisterKeyMapping`</mark> as described in the FiveM documentation. This eliminates the need for while loops that check for key presses every frame, improving the resource's performance. The native works by triggering the chat command it's linked to when the keybind is pressed. Additionally, this approach lets each player customize their key bindings within the game. go to `GTA5 settings > Key Bindings > FiveM`

## <mark style="color:blue;">How to Unbind Keys</mark>

After the resource is started on your server for the first time, modifying the key in your script's config will not impact players who have already joined. However, the new keybind will take effect for any players who join after the change is made

{% tabs %}
{% tab title="Option 1" %}
To unbind keys **for your client only** you can type `unbind keyboard`[`input_parameter`](https://docs.fivem.net/docs/game-references/input-mapper-parameter-ids/keyboard/) in F8

{% hint style="info" %}
Example - `unbind keyboard F10`
{% endhint %}

{% endtab %}

{% tab title="Option 2" %}

* Open File Explorer and navigate to `C:\Users\[USERNAME]\AppData\Roaming\CitizenFX`.
* Locate and open the `fivem.cfg` file using a text editor.
* Find and remove the lines related to the specific resource name.
* Save the changes to the `fivem.cfg` file.
* Restart FiveM to reset the keybinds to the default values set in the configuration
  {% endtab %}
  {% endtabs %}

{% hint style="info" %}
You can find the complete list of available keys [here](https://docs.fivem.net/docs/game-references/input-mapper-parameter-ids/keyboard/)
{% endhint %}


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter, and the optional `goal` query parameter:

```
GET https://grootdev.gitbook.io/groot-development/coding-information/register-key-mapping.md?ask=<question>&goal=<endgoal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is optional and describes the broader end goal you are ultimately trying to accomplish on behalf of the user. GitBook uses it to tailor the answer towards what is most useful for that goal.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
