Original Post
Trying to work on some sort of a button assignment system to change key bindings for controllers and keyboards. I have some sort of foggy idea about how I would do this, but I reach a point where the idea escapes me a little bit. Both direct input and Xinput's buttons correspond to an int, so it would seem simple enough to be able to attach that int to a string to symbolize the function the button has in the game (as the player prefers). But I'm a little unsure of how I would set this up.
In case I'm explaining this poorly, this is sort of how I would like it to work:
A menu queries the player to press the button he wants to use to Jump.
Player presses the button he wants to use for Jumping.
That button returns its int value corresponding to that button, and the game stores that int somewhere and correlates it to the action/function.
Anytime the button is pressed with that value, the game will relate it to the "Jump" button.
And if at a later time the player would like to do so, he can reassign the button to another function, and use a different button for Jump.
In case I'm explaining this poorly, this is sort of how I would like it to work:
A menu queries the player to press the button he wants to use to Jump.
Player presses the button he wants to use for Jumping.
That button returns its int value corresponding to that button, and the game stores that int somewhere and correlates it to the action/function.
Anytime the button is pressed with that value, the game will relate it to the "Jump" button.
And if at a later time the player would like to do so, he can reassign the button to another function, and use a different button for Jump.