RegisterKeyMappingFiveM Documentation. This removes the need for while loops checking every frame for keypresses, therefore allowing the resource to be more optimised. This FiveM native works by triggering the chat command it has been registered with when the keybind is pressed. This new method also allows each client to change their own key binds in game. Example
Open Gta5 settings > Key Bindings > FiveM.
IsControlJustReleasedor other methods to trigger the events we provide to you in our docs.