Hello all, thank you for reading.
In my project, a physics-based minigame creator, I am working on mechanics which can be triggered with a button press. I would like the creator of the minigame to choose which button should be pressed to activate said mechanics.
For example, the creator can add a rocket booster to an object, and set its action key to E. Then, when the minigame is played, the rocket booster will be activated WHILE the player holds down E.
Normally, I would do this with simple bindings, but this is not an option here given how I want virtually any key to be detected. Setting <Keyboard>/<anyKey> does not help, as it does not provide the specific key pressed. I was able to find a workaround using the wildcard <Keyboard>/*, and although this does not provide me with the exact Key code, I am able to obtain it through enum parsing.
However, this introduces a whole new issue of its own. The ‘performed’ event is not called when I start pressing the key, instead triggering alongside the ‘canceled’ event. For the record, the Action Type is set to Button. I have tried using Value but this has not been helpful. Using ‘context.performed’ has the same issue.