If you want to change the default key bind for all players, you MUST change it in the configs/config.luaBEFORE starting the resource on your main server.
We have started using the FiveM native called 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. ExampleOpen Gta5 settings > Key Bindings > FiveM.
How to Unbind Keys
Once you have started the resource on your server for the first time, even if you change the key in the config.lua, it will not change for the players who have already joined. Although it will change for the players who join after you have changed it.
To unbind keys for your client only you can type unbind keyboardinput_parameter in F8.
Go to C:\Users[USERNAME]\AppData\Roaming\CitizenFX
Remove the lines with this resource name.
Restart Fivem. Keybinds will be set back to default values set in the config.
How to Disable KeyMapping
Firstly unbind the keys using the method above, disable the key in the config.lua and then you can rewrite the code to use the regular method of while loops checking for key presses IsControlJustReleased or other methods to trigger the events we provide to you in our docs.
There is no way to mass unbind keys for all of your server's players.
The full list of available keys can be found here.