I’ve been looking around to set up dynamic keybinds for a game, and I not sure how it ought to be configured.
At the moment I have the following (I’m using dear imgui).
In imgui, I can detect when I have clicked a button. That button signifies that I want to set a keybind. But how do I capture the next key pressed (after I have clicked the button) in a glfw window?
There is a key callback method I have created, but that key callback method has no idea whether or not I have clicked the button in imgui previously; it simply responds when I have pressed a key.
I was thinking about having a boolean check in my callback method, which I would set when I click the button so that the callback method would know whether or not the keypress should be used in a keybind.
Are there any better approaches to this?