Method SaveKeyMappings on UInputSettings can not save any configs

is there a Unreal engine 4’s bug?

I want to remapping short-cut in my game with following code:

Code:
const FName name = FName(“MKey”);
const FInputActionKeyMapping fInputActionKeyMapping(name, EKeys::M);
const UInputSettings* DefaultInputSettings = GetDefault();
((UInputSettings*)DefaultInputSettings)->RemoveActionMapping(fInputActionKeyMapping);
((UInputSettings*)DefaultInputSettings)->SaveKeyMappings();

aPlayerController->PlayerInput->ForceRebuildingKeyMaps();

But the “DefultInput.ini” have nothing changed.

and how can I Make my remapping work right now. Now it just can work in next time I start game

Try this

((UInputSettings*)DefaultInputSettings)->SaveConfig();
aPlayerController->PlayerInput->ForceRebuildingKeyMaps(false);