Have some general definitions like "X Axis", "Y axis" with positive, negative fiels, Button 1, Button 2 ... in some table definition for input. Users can bind one or multiple entries for each definition.
Example
Up = "A", "mouse Left"
Down = "B", Joystick Down"
...
User code uses general definitions instead of hard coded values.
Example above, user code is using "Up" , when the game plays it will work for key "A" or Left mouse pressed.