Hello all,
I am designing a menu for my game. In my menu, I am implementing several options. The usual stuff, audio, video, and keyboard options.
However, I am trying to find a way to allow the user to modify the default keybindings for the game. So, basically, here is my question.
How do you record a keypress event? i.e., they press a button to change a specific keybinding and then the system will accept the next keypress as the new keybinding for the action.
So in the menu you would see something like this:
Forward = W (BUTTON HERE TO CHANGE BINDING)
Back = S (BUTTON HERE TO CHANGE BINDING)
Right = A (BUTTON HERE TO CHANGE BINDING)
Left = D (BUTTON HERE TO CHANGE BINDING)
So, if I press the button next to ‘Forward = W’, the system will listen for the next keyboard keypress. I have all the functions set up and ready to go, I just can’t figure out how to listen for any key press and record the button that was pressed. Any ideas? Thanks in advance for the help.