Hotkeys
Last updated
Last updated
Cyber Engine Tweaks allow mods to register hotkeys that can be assigned by the player in the CET Binding screen, and execute custom code once pressed. There are two kinds of hotkeys:
Hotkeys and Inputs, while having similar functionalities, are displayed in two separated groups.
Remember to register Hotkeys/Inputs at root level, outside of any event.
Hotkeys & Inputs are displayed in the CET Bindings screen 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.
Hotkeys & Inputs can be triggered by the user from anywhere, at anytime, as soon as CET loaded your mod (even earlier than 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.
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.