Jump to content




mouse_drop event


10 replies to this topic

#1 GopherAtl

  • Members
  • 888 posts

Posted 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.

#2 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

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!

#3 lieudusty

  • Members
  • 419 posts

Posted 03 January 2013 - 04:35 PM

This sounds like a great suggestion! Drag and drop would be much easier.

#4 GopherAtl

  • Members
  • 888 posts

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.

#5 Bomb Bloke

    Hobbyist Coder

  • Moderators
  • 7,099 posts
  • LocationTasmania (AU)

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!

#6 GopherAtl

  • Members
  • 888 posts

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...

#7 Lupus590

  • Members
  • 2,029 posts
  • LocationUK

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!

Edited by Lupus590, 05 March 2015 - 03:07 PM.


#8 dan200

  • Administrators
  • 542 posts
  • LocationCambridge, England

Posted 05 March 2015 - 07:29 PM

I'm implementing this now.

#9 GopherAtl

  • Members
  • 888 posts

Posted 05 March 2015 - 07:35 PM

View Postdan200, on 05 March 2015 - 07:29 PM, said:

I'm implementing this now.

woohoo!

:does the happy dance:

Thanks dan :D

#10 Lyqyd

    Lua Liquidator

  • Moderators
  • 8,465 posts

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

#11 Lupus590

  • Members
  • 2,029 posts
  • LocationUK

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 by Lupus590, 05 March 2015 - 07:49 PM.






1 user(s) are reading this topic

0 members, 1 guests, 0 anonymous users