Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[1.12.2] Scrolling mouse wheel when hovering on top of GUI Widget fires doubleClickEvent #121

Open
PolyacovYury opened this issue Sep 7, 2020 · 1 comment

Comments

@PolyacovYury
Copy link

    @Override
    public Widget<?> mouseClick(int x, int y, int button) {
        // snip
        long t = System.currentTimeMillis();
        if (prevTime != -1 && (t - prevTime) < 250) {
            fireDoubleClickEvent(selected);
        }
        prevTime = t;
    }

As you can see, any mouse click event fired in quick succession causes children to react to a double click. It doesn't matter, what button was pressed - left click, right click or mouse scroll.

Result: scrolling in XNet Controller GUI when mouse is hovering on top of one of the blocks' lines results in GUI closing and highlighting that block.

@PolyacovYury
Copy link
Author

The problem traces back to the fact that Minecraft itself fires mouseClicked event in handleMouseInput even if no mouse button was pressed but the scroll wheel.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant