controlp5
controlp5 copied to clipboard
Controller shouldn't deactivate on mouseDrag
I think controlP5 would feel much more responsive as a whole if you were able mousePress to activate a controller then move your x/y coordinates before mouseRelease, and still call the event of the button/listItem/etc. Right now, I have a number of scrollableLists and buttons, and if I press, accidentally move at all, and then release if feels like it should click, but doesn't... This would be a big fix for the overall feel of the library.
If this is already possible, please let me know!
https://forum.Processing.org/two/discussion/19065/controlp5-responsiveness-issue
can you give an example, a working sketch that highlights the problems you encounter?
This comment is also based on the discussion posted by the OP in the Processing forum.
A mouse 'click' generates 3 events in this order
- PRESS
- RELEASE
- CLICK (provided the mouse has not moved between (1) & (2)
If the mouse moves between (1) and (2) the you get multiple DRAG events
- PRESS
- DRAG
- DRAG ... ?) RELEASE
The first is appropriate behaviour for a GUI button and gives the user an opportunity to cancel a button-click by moving the mouse before releasing the mouse button. The second is appropriate for a slider.
Although it should be possible to modify the GUI button behaviour so that a CLICK event is fired provided the mouse has not left the button surface before RELEASE, it would not be the expected behaviour of 99.9% of users.
In fact I don't think this is an issue with controlP5. I think that the controllers are responsive, they just don't respond in the way the OP wants.
thanks @quarks for this. @conorrussomanno you can take a look at the ControlP5callback example to customize controller actions. Like quarks already highlighted, the behavior you are describing results in a drag-action which cancels out the click-action but still triggers the release-action when the mouse is released inside. An outside release is detected as a releasedoutside-action. If this answers your question, please close the issue.
Thanks, guys. I'll give it a try and close the issue (in addition to posting my solution) if I can fix the bug.