This is a read-only snapshot of the ComputerCraft forums,
taken in April 2020.
mouse_drop event
Started by GopherAtl, 30 December 2012 - 08:39 AMPosted 30 December 2012 - 09:39 AM
depending on what you're using the existing mouse_drag events for, it would be nice to have a mouse_drop event sent when the user releases the mouse while dragging. Sometimes it's practical to just treat every drag as a drag+drop from the last clicked or dragged position, but other times it would be nice to avoid handling the drop actions repeatedly along the way. Example, if you were doing a gui-based file manager with drag and drop of files, you don't really want to move the file every time the mouse moves, only once when the drag ends. I suppose you could use a timer to do a "drop" after a certain interval without another drag event, and end the drag if a new click is recieved, but that feels a bit clunky.
Posted 30 December 2012 - 09:46 AM
I fully support this suggestion. I've been kicking around ideas about how to implement drag and drop support for a while now, and this event would really be the missing piece of the puzzle!
Posted 03 January 2013 - 04:35 PM
This sounds like a great suggestion! Drag and drop would be much easier.
Posted 05 March 2015 - 01:56 AM
bump for begging. Pls, dan, pls. I know next version's probably a ways off, but…
Making edit+, I've found yet another use case where not knowing when a drag operation ends can't effectively be worked around. You can drag-select text, and if I had a drop event, I could use a timer and have it scroll (and thus extend selection) at when you drag to the edge and hold. If I just do the timer and assume the drag continues until some other event happens, then it becomes a very frustratnig feature to use effectively, because it is so unexpected for it to continue scrolling (And expanding the selection) after you've released the button.
Making edit+, I've found yet another use case where not knowing when a drag operation ends can't effectively be worked around. You can drag-select text, and if I had a drop event, I could use a timer and have it scroll (and thus extend selection) at when you drag to the edge and hold. If I just do the timer and assume the drag continues until some other event happens, then it becomes a very frustratnig feature to use effectively, because it is so unexpected for it to continue scrolling (And expanding the selection) after you've released the button.
Posted 05 March 2015 - 07:22 AM
Just on the off chance that use-cases sway the, uh, case: The main reason I've been +1'ing all the mouse_release suggestions is so I can have drag'n'drop in my card game.
Mind you, that script relies on external monitors (for the extra display real estate), and it occurs to me that it might be harder to get release events for those. Dunno. Still would be a boon to have them, even if just for regular computer displays!
Mind you, that script relies on external monitors (for the extra display real estate), and it occurs to me that it might be harder to get release events for those. Dunno. Still would be a boon to have them, even if just for regular computer displays!
Posted 05 March 2015 - 01:21 PM
hrm, not sure I see how you could do release events for monitors, since the right-clicking that becomes a monitor_touch event is an instant event that doesn't have a duration. Which is why there aren't currently even monitor_drag events…
Posted 05 March 2015 - 03:06 PM
Would be nice to be able to get mouse position while users are not clicking too, but that's another topic (and falls over when there are more than one user).
Consider this post a sign of my support!
Consider this post a sign of my support!
Edited on 05 March 2015 - 02:07 PM
Posted 05 March 2015 - 07:29 PM
I'm implementing this now.
Posted 05 March 2015 - 07:35 PM
I'm implementing this now.
woohoo!
:does the happy dance:
Thanks dan :D/>
Posted 05 March 2015 - 07:38 PM
I'm excited! This'll make for some interesting new functionality being possible! I'll have to work out some interprocess drag & drop feature now. :D/>
Posted 05 March 2015 - 07:45 PM
Now is the hard part, waiting for the release/beta. (Or in Dan's case, prying the bugs off of the new features.)
Edited on 05 March 2015 - 06:49 PM