Morphic in Snap!

I am making a version of Morphic in pure Snap!. (the "!" should be more italicized) I have a problem, though, which is that Snap! currently has no way to programmically detect a right-click. (I can detect a Ctrl-click, though. But Ctrl detection is buggy in Snap!. So Shift-click maybe?)



  • link to project
  • dragging
    • dragging threshold
  • click detection
  • hold detection (lucky for mobile users)
    • long-hold length
  • a little mouse-over brightness change (currently unused)
  • user-customizable
    • dragging threshold
    • long-hold length


  • clean up code a little bit

Is middle-click detection more reliable than ctrl-click?

If so, maybe simulate right-click with both shift-click (for those without 3 buttons) and middle-click?

I'm assuming it is.


Why did I call that "Smap!"?

I can do


I can't.

Maybe try and make it detect a long-click?

I'm not quite sure how to do that.

I've not tried to do it either but it's worth a go I think

There is extended example of any mouse button detection.

I'll have to implement a dragging threshold first.

Nice! But can it detect no button being pressed?

Maybe double-click instead then?

Just slinging ideas out here :slight_smile:

Long-hold isn't that hard, once you've got a dragging threshold.

Or keep track of mouse position when event detected and decide between stationary click and click hold and drag?

Mouse Buttons III script pic (1)
Mouse Buttons III script pic (2)

I'll need an understanding of what the return codes are.

Edit: Oh and I want this

I just got dragging threshold working, so it shouldn't be too hard to get long-hold working.

My simple effort


Here's my code: (Pro tip: You can right-click a script and click "Script pic..." to not have the background)

(dragging) is the dragging threshold.

Really - I had no idea.........

It's also higher quality.

My "pro tip" :slight_smile:

Switch to dark mode and then you won't notice :slight_smile: