The Tabageos ControllerPad Class does a similar thing. It will tell the user to press the input buttons and defines each button that way from user input.
For most pads the directional buttons don't need to be user defined since they all mostly operate by axis.