I tried to attach function calls to all the button presses of my controls, and then use the resulting functions to move the player so I could easily make gamepad or keyboard controls where they can be toggled between each other in the game's settings, but this method proved to be a failure and didn't work at all.
Is there an easy way to implement keyboard controls and gamepad controls which can be toggled without making my code a total mess?