| Summary: | MouseEvent button on MouseDraggedEvent | ||||||||
|---|---|---|---|---|---|---|---|---|---|
| Product: | [Tools] GEF | Reporter: | Manuel Selva <manuel.selva> | ||||||
| Component: | GEF-Legacy Draw2d | Assignee: | gef-inbox <gef-inbox> | ||||||
| Status: | RESOLVED WORKSFORME | QA Contact: | |||||||
| Severity: | enhancement | ||||||||
| Priority: | P3 | ||||||||
| Version: | unspecified | ||||||||
| Target Milestone: | --- | ||||||||
| Hardware: | PC | ||||||||
| OS: | All | ||||||||
| Whiteboard: | |||||||||
| Attachments: |
|
||||||||
|
Description
Manuel Selva
Created attachment 55969 [details]
Snippet which showing the value of me.button is always 0
When clicking on the click here figure a label is displayded indicating the event nature and the associated button.
Created attachment 55970 [details]
Proposed patch , modification in SWTEventDispatcher dispatchMouseMoved method
Proposed solution,
Add a test in SWTEventDispatcher dispatchMouseMoved method on me.stateMask to find the pressed button.
As your patch demonstrates, there is no way to store a meaningful value when more than one of the 5 mouse buttons is pressed. We could add a convenience method, but it is a very small amount of code that is being "saved". (In reply to comment #3) > As your patch demonstrates, there is no way to store a meaningful value when > more than one of the 5 mouse buttons is pressed. We could add a convenience > method, but it is a very small amount of code that is being "saved". > Thanks for your quick answer Randy, What do you mean by convenience method ? On which object ? Mouse Event ? And what do you mean by "small amount of code that is being "saved"" ? Concerning the fact that we can't store a meaningfull value if more than one button is pressed i agree with you. But does it take sense for any GUI to react to a "bi button" mouse event ? Manu You are complaining about having to call:
(event.getState() & SWT.BUTTON1) != 0;
that is not much bigger than:
event.getButton() == 1;
> You are complaining about having to call:
Sorry, "complaining" was not the right word choice. Community feedback is always welcome.
You are right, I can directly use (event.getState() & SWT.BUTTON1) != 0; . As you told it i am not complaining but just trying to help you and to 'contribute' Draw2D giving you my feedback... Thanks Manu re-closing worksforme |