Old method creates a while-loop and check every frame if the key is pressed, it takes some cpu usage. This new method don’t take any “cpu usage” from the resource.
The only keys you should thread are keys that aren’t static (only used for 1 thing [inventory/phone/etc])
I don’t see the difference between this and the RegisterKeyMapping native above other than you execute a function and the native handles it via commands.
You should add into the import.lua file the controller layout name and the keys.
I didn’t added them because I don’t have a controller to get them, if you can get the layout and the name of the keys and share it I will be adding it to the resource.
How to get more keys:
How I search for keybinds is to bind it in FiveM and then extract it from the fivem.cfg config file:
Location:%appdata%\CitizenFX\fivem.cfg
You will see a keybind like: rbind {resource name} {defaultMapper} {defaultParameter} {command}
Example: rbind keybind_example MOUSE_BUTTON MOUSE_LEFT "+example_keybind"
Where MOUSE_BUTTON is defaultMapper and MOUSE_LEFT is defaultParameter