[Closed] Key mapping: Revert to Default Keys
I'm trying to figure out the right way to implement a "Revert to Defaults" feature in my "change key mappings"-UI. I found and read [this post], but I am still not sure what the right approach for this is.
I notice there are already two input config files, one Input.ini located in the Save folder and the DefaultInput.ini. With the system I have set up now (when playing in the editor) it looks like the Input.ini is the only one changing when I remap keys. Would it be possible to load the keys set in DefaultInput.ini and use these as defaults?
Have a great day!
The question has been closed Dec 30 '16 at 08:45 PM by AndrewHurley for the following reason:
The question is answered, right answer was accepted
In general we don't recommend modifying the input settings directly for remapping. I'm copy/pasting a response I made on a similar question that was marked private that is basically about the same issue:
The approach that Fortnite has taken and I believe is probably a reasonable model is to use the Project Settings as your defaults. Then within your game's saved user settings store a list of modified input settings.
Whenever a setting is changed or the Player Controller initializes its input system, the modified settings are applied to the Player Input object such that the old mappings are removed and the new mappings added. To reset to defaults simply throw away the user's modified bindings list.
It is always important to remember to call ForceRebuildingKeyMaps on the PlayerInput after any changes are made to its view of the Action or Axis Bindings.
answered Dec 30 '16 at 08:43 PM
Follow this question
Once you sign in you will be able to subscribe for any updates here