Key mappings: any cleanup option?

Is there also going to be a good way to “clean” up the RegisterCommand settings that are being stored in the config file in %appdata%\CitizenFX\fivem.cfg

After testing the RegisterCommand I saw that ALL the options that I tested with are now stored in the file, when pressing the button it will send ALL of those commands.

  • I would expect after the client logs out those keybindings are being “removed” from the fivem.cfg file

No. What would you expect as a trigger for such, since it’s impossible to tell a resource is edited to not register a backing command anymore?

…? Then the player would have to rebind changed keys in settings every time they join, that makes no sense.

I would expect there to be a command RemoveCommand that can be called when the resource stops / server stops that will remove that keybinding.

  • Another way of doing it would be to make a separate config file that gets loaded after the fivem.cfg is loaded which can be “deleted” after you logoff.

Regarding rebinding, my understanding of this function is that we can “force” keybinding onto keys we can’t normally use as they don’t have keybinding in the original game like F4. Being able to bind those keys to commands makes it less hard as a resource developer to come up with smart tricks for all the keybinding that we can bind.

That again makes no sense, bindings are already per resource, tied to the name.

And again, what? How does this make any sense?

No, it makes it so you can bind keys that are rebindable by end users in the pause menu. That’s why they’re persisted to disk.

I was going to explain why I think RegisterCommand should be a command that allows resource developers to force certain keys onto the end users but reading your response makes it clear that the command is not meant to force keys onto the end user.

The idea behind the "cleaning" is that many keys within the resources I use tend to change on a weekly basis to battle the "autoclickers" and I was hoping that with this command the possibility to take that away would appear.

1 Like

Maybe to force binds to keys can be another feature, sounds like a really good idea, as the IsControlPressed native is really hard to use.

*bad idea, overriding user preferences is literally a thing we won’t allow you to do

imagine if you ‘force’ something to num* and people don’t have a numpad

or you force something to ‘end’ and someone’s playing with a 60% keyboard

that also doesn’t ‘force binds to keys’ though, as all the keys there are also rebindable in the pause menu?

1 Like

??? and you’re trying to fix a behavior issue (your server is boring -> people want to automate tedious tasks) in a weird way (get rid of users’ ability to build muscle memory or remember what key does what as a side effect) instead of relying on better detection for automated input (is anything else happening at the same time? maybe rate limit what people do? maybe make your server less boring)

2 Likes

Right, forgot about that…

I was going to make a extensive post here but seems that you already made the point from the FiveM developers side so I am going to rely on the fact that developers know best.