Fabric API

Fabric API

112M Downloads

Don't ignore vanilla result for `ScreenMouseEvents$After*` and `ScreenKeyboardEvents$After*` events

Fuzss opened this issue ยท 1 comments

commented

The vanilla Screen methods running before those events all have a boolean return type representing if the screen event was handled by the screen (or a widget on the screen). Fabric Api ignores that result, so there is no way of knowing if the screen method event was already handled.

It would be great to either not fire after events if the screen method event was already handled by vanilla (that's how the implementation for Post events on Forge/NeoForge works), or to at least include the result as an event parameter.

In some cases vanilla ignores the returned boolean when the screen method event call is the last statement in a method, but the result can easily be captured by using MixinExtra's @WrapOperation injector.

commented

Thanks for the issue. I see this boolean. I dont think we want to stop firing the event.

I think ideally we would want to pass this boolean through to the event handler. However to do so will require us to deprecate and replace the old event.