Hey! Im making a controller config option for my game and I came across a little bug. Program works like this:
If Button is pressed on config screen, it calls for input.update() which polls every device (limited it to keyboard and gamepads) and returns a vector of strings. Now config program reads firstElement of the vector and assigns it as label text.
Anyways, if you pressed lets say “any” key before actually pressing any button and then pressed the button to assign a value, it would assign it as “any” key. Is there a way to clear input buffer or smth?
Question 2: Is it good to save config as a file and in the main program if any key is pressed it checks if that key’s value is assigned to any function? (eg. Player 1 assigned “X” key to attack on his gamepad and if “X” key is pressed in game, it would make him attack?)