No got it backwards Sirp, minwah is correct in that the key assignments need to be removed from the cfg files, leaving ctrlr files left alone.
Why?
It's real simple.... cfg data, other than the key configs contain "real" data. That is data that would actually be stored on the real arcade machine via dip positions, counters, ect.
Key assignments, on the other hand are virtual and pertain only to mame.
Cfg data, generally should be changed when a driver is updated, while key configs, 9 times out of 10 should be left in tact.
So it's more logical to keep the two data types separate rather than merging them in the cfg like they are now.
Logically speaking, at least, modifying mame to work with this method would be a breeze.
Input (General) and Input (This Game) would have company.
Input(This Driver) and Input(This Parent) would need to be added.
Also the glitch/oversight in the current ctrlr files would need to be fixed, where entries are read in the order they are printed in the file and not in the hierarchy (default,driver,parent,clone).
Other than that it's just a matter of re-routing the save to the ctrlr file rather than the cfg files. Since they use the same writing method now, in theory, it'd be easy.