# Hotkeys

## Introduction

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

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

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

<figure><img src="https://2893586400-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2F-MP5jWcLZLbbbzO-_ua1-887967055%2Fuploads%2FXVnWqKHtUXMTP1PBUmm4%2Fcet-guide-hotkeys.jpg?alt=media&#x26;token=d1e347d0-e6dc-4f20-9e6c-99af937ff55a" alt=""><figcaption></figcaption></figure>

## General Notes

{% hint style="warning" %}
[Hotkeys](https://wiki.redmodding.org/cyber-engine-tweaks/cet-functions/hotkeys/registerhotkey) 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](https://wiki.redmodding.org/cyber-engine-tweaks/cet-functions/hotkeys/registerinput) instead, as they are always triggered.
{% endhint %}

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

{% hint style="info" %}
Hotkeys & Inputs are displayed in the [CET Bindings screen](https://wiki.redmodding.org/cyber-engine-tweaks/console/bindings) 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](https://wiki.redmodding.org/cyber-engine-tweaks/cet-functions/events/oninit) 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="hotkeys/registerhotkey" %}
[registerhotkey](https://wiki.redmodding.org/cyber-engine-tweaks/cet-functions/hotkeys/registerhotkey)
{% endcontent-ref %}

{% content-ref url="hotkeys/registerinput" %}
[registerinput](https://wiki.redmodding.org/cyber-engine-tweaks/cet-functions/hotkeys/registerinput)
{% endcontent-ref %}
