# Hotkeys

## Introduction

Cyber Engine Tweaks allow mods to register hotkeys that can be assigned by the player in the [CET Binding screen](/cyber-engine-tweaks/console/bindings.md), and execute custom code once pressed. There are two kinds of hotkeys:

* [Hotkeys](/cyber-engine-tweaks/cet-functions/hotkeys/registerhotkey.md) are triggered on key release
* [Inputs](/cyber-engine-tweaks/cet-functions/hotkeys/registerinput.md) are triggered on key press and release

Hotkeys and Inputs, while having similar functionalities, are displayed in two separated groups.

<figure><img src="/files/jcayeOMvrWJ9O58ub8S5" alt=""><figcaption></figcaption></figure>

## General Notes

{% hint style="warning" %}
[Hotkeys](/cyber-engine-tweaks/cet-functions/hotkeys/registerhotkey.md) are not triggered while the player stay pressed on a game's keybind.

For example, if the player move forward with "W" and press a Hotkey at the same time, it won't be triggered.

For this reason, it is recommended to use [Inputs](/cyber-engine-tweaks/cet-functions/hotkeys/registerinput.md) instead, as they are always triggered.
{% endhint %}

{% hint style="info" %}
Remember to register Hotkeys/Inputs at root level, outside of any [event](/cyber-engine-tweaks/cet-functions/events.md).
{% endhint %}

{% hint style="info" %}
Hotkeys & Inputs are displayed in the [CET Bindings screen](/cyber-engine-tweaks/console/bindings.md) sorted in the order they were registered in the code. If you want to sort hotkeys by label in ascending order for example, you'll have to change the registration code order accordingly.
{% endhint %}

{% hint style="info" %}
Hotkeys & Inputs can be triggered by the user from anywhere, at anytime, as soon as CET loaded your mod (even earlier than [onInit](/cyber-engine-tweaks/cet-functions/events/oninit.md) event).

Which means the user might press your hotkey in the Main Game Menu or in Settings Menu. You have to keep that in mind when working with hotkeys, and make sure your script is executed where it is supposed to.
{% endhint %}

{% hint style="info" %}
Hotkeys & Inputs are triggered on top of the game's keybinds. Which means it's possible that player set a hotkey on "R".

In-game, when the player use "R" to trigger your script, it will also trigger the game's Reload function.
{% endhint %}

## Available Functions

{% content-ref url="/pages/DkKxpKO8HXLZpFmUKfsC" %}
[RegisterHotkey](/cyber-engine-tweaks/cet-functions/hotkeys/registerhotkey.md)
{% endcontent-ref %}

{% content-ref url="/pages/0P5oWd3zPfVkLRd4VyVa" %}
[RegisterInput](/cyber-engine-tweaks/cet-functions/hotkeys/registerinput.md)
{% endcontent-ref %}


---

# Agent Instructions: 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:

```
GET https://wiki.redmodding.org/cyber-engine-tweaks/cet-functions/hotkeys.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
