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.
Thanks, that is actually genuinely really helpful!
I was just asking to see if there is any generally agreed-upon application structure for dynamic keybinds in glfw, but it appears that the way to go is to just have some sort of indicator in your key callback that the pressed key is to be used for a keybind.