fabric icon indicating copy to clipboard operation
fabric copied to clipboard

Add consume for after screen mouse events

Open kevinthegreat1 opened this issue 8 months ago • 3 comments

Allow listeners to check if the click has been consumed and consume the click.

This pr is lacking in comments as I am looking for feedback at this stage. The names should be updated based on suggestions.

kevinthegreat1 avatar May 07 '25 15:05 kevinthegreat1

Whats the use case? Im just familariising myself with this code as its been a while.

We already have a AllowMouseClick that would allow you to consume a click, and stop others from doing so, its not clear to me what you gain from adding this?

modmuss50 avatar May 07 '25 16:05 modmuss50

Whats the use case? Im just familariising myself with this code as its been a while.

We already have a AllowMouseClick that would allow you to consume a click, and stop others from doing so, its not clear to me what you gain from adding this?

The main use case is it allows you to process a click when no other buttons get clicked. For example you want to detect when the user clicks anywhere on the screen, but not when an existing button/element is pressed.

kevinthegreat1 avatar May 08 '25 01:05 kevinthegreat1

The main use case is it allows you to process a click when no other buttons get clicked. For example you want to detect when the user clicks anywhere on the screen, but not when an existing button/element is pressed.

I see, that sounds quite niche imo. Could that be done easily with a mixin, if its only needed for one mod then id lean towards this being out of scope.

modmuss50 avatar May 13 '25 18:05 modmuss50

The 25w36a changes necessitates breaking changes to these mouse events, I am going to include the changes in this PR into the 25w36a port so we dont need to juggle 2 copies of this api.

modmuss50 avatar Sep 02 '25 16:09 modmuss50

Superseeded by: https://github.com/FabricMC/fabric/commit/c8811bddbb6e679bc510a3fdf501fbfce94fb824

Thanks for the PR.

modmuss50 avatar Sep 02 '25 17:09 modmuss50