-
Notifications
You must be signed in to change notification settings - Fork 286
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
Fix left click targeting issue #2827
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks mostly good, just two comments first
@@ -1477,16 +1477,10 @@ public void hexMoused(BoardViewEvent b) { | |||
if ((b.getModifiers() & InputEvent.CTRL_DOWN_MASK) != 0) { | |||
return; | |||
} | |||
if (clientgui.getClient().isMyTurn() |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why remove this check? I did note it wasn't part of the other ones though
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Restored.
I found the root cause as to why using the BUTTON1_DOWN_MASK behaves differently than the original BUTTON1_MASK. For example FireDisplay.java and others implement this check to bail if not mouse button 1:
This used to work fine, but now, on mouseReleased() will always look like the button1 was not used and will therefore exit before doing it's left-click payload such as selecting the hex for target. To properly fix this, I believe, if I fix this properly, the "flip/twist" functionality can be restored correctly if desired. |
For example, if the user presses button 1 followed by button 2, and then releases them in the same order, the following sequence of events is generated: MOUSE_PRESSED: BUTTON1_DOWN_MASK //note the mask modifiers for the releases are 0 for the button being released. |
Revert "Merge pull request #2827 from NickAragua/fix_left_click_issue"
Fixes #2819
The first commit is coalescing the drag and click handling into doing the same thing, as the "drag" functionality in these displays didn't seem to be doing anything at all.
The second commit is cleaning up unused variables and enabling the user to flip arms without resetting torso twist state (technically it's a push/pop, but details).