So I've been fiddling with this, but I just cannot figure it out.
I want to do the typical options menu for changing controls: select an action from the list (for example 'JUMP'), a 'please press the key' pop-up appears (or not, doesn't matter) and the next key you press gets saved as the input for that action. Could someone provide me with a snippet of example code or just explain thoroughly how to do this (as in just catching the input event part)?
Also, I'd like to save this configuration to a file and be able to load it later on. Again, I'm not quite sure what to save here, especially that I'd like this to also support gamepads.