Input handler could pass handling down the stack

At the moment, you can push an input handler onto the stack and if it handles a particular input, that input is blocked whether or not the handler actually processes the input. It would be useful if button handlers could return whether or not they handled the input so that in the event they do not, the input can be passed to the next handler down the stack that does process that input.

1 Like

We have something similar already: when you push an input handler, by default any functions not defined in the new handler will cascade down the stack. (To prevent this, pass true for the masksPreviousHandlers argument.) See the documentation for inputHandlers.push().

1 Like

Yep. But imagine I have a UI system that listens for A button presses and is only interested in them if the cursor is over a button, otherwise it's happy to have other handlers try to process that input.
I guess it's not a common use case. I can see myself running into it on this project but I can work around it!

Ah, gotcha. You could set and unset various input functions as the condition changes, but that might mean checking it every frame instead of just on button press. I'll file it as a feature request. Thanks for the suggestion!

2 Likes