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

[Request] Improve comparisons for MouseButton #9

Open
x4e opened this issue Jul 9, 2020 · 1 comment
Open

[Request] Improve comparisons for MouseButton #9

x4e opened this issue Jul 9, 2020 · 1 comment

Comments

@x4e
Copy link

x4e commented Jul 9, 2020

The provided MouseButton enum is very useful, however has some problems.

Multiple mouse buttons are defined for the same underlying id (e.g. 1 and LEFT both have the same id of 0).

This means the following expression will evaluate to false: MouseButton.of(0) == MouseButton.LEFT.

Potential solution:
Remove enum types 1, 2, 3, LAST. This would break backwards compatibility.

Perhaps there is another solution that doesnt break backwards compatibility?

Sadly its not possible to override Enum.equals which would probably be the best solution.

@elect86
Copy link
Collaborator

elect86 commented Aug 26, 2020

Hi @cookiedragon234,

I see the problem.. what about moving the LEFT and so in the companion object?

Ps: sorry for the late reply but I took some paternity time

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

2 participants