Get_key_mapping

This is something I’ve seen a few players asking for a way to get a players current key mapping for mappings set in REGISTER_KEY_MAPPING.

Example of what it would look like would be GetKeyMapping('+bindedkey', [0|1]) whereas 0 is the ‘native’ number game key, and 1 being the actual string key.

^ This could probably get split into two different natives to make it simpler, possibly GetKeyMappingString and GetKeyMapping.

This could be useful in two main situations

Its use cases:

  1. Ability to integrate the current key mapping into the NUI.
  2. Using the same command/key across resources, would prevent having to do a net event and possibly allow me to get it in a more friendly way, example: IsControlPressed(GetKeyMapping('+radiotalk', 0))

Except this wouldn’t help with that at all, as the key specified may very well be one that’s not passed to NUI at all (like a gamepad button) or otherwise not directly matching a JS key name, especially across keyboard layouts.

Huh? You can ‘use the same command/key across resources’ already, and why the hell do you want to stick to polling (and similarly, how would this help? custom keys have zero relation to controls and can’t even overlap an existing control).

Also, that’s a local event, not even a net event?

Ah, yea, that would make it pretty useless as quite a few people do use game pads :frowning:

derp :laughing: