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?)
Updates:
v0.1:
link to project
dragging
click detection
hold detection (lucky for mobile users)
a little mouse-over brightness change (currently unused)
user-customizable
v0.2:
clean up code a little bit
Is middle-click detection more reliable than ctrl-click?
I found this custom block for detecting a right mouse click by @dardoro , but I'm not sure how to extend it to the middle mouse button.
[Smap! script pic (4)]
If so, maybe simulate right-click with both shift-click (for those without 3 buttons) and middle-click?
I'm assuming it is.
[offtopic]
Why did I call that "Smap!"?
[/offtopic]
cymplecy:
shift-click
I can do
warped_wart_wars:
in pure Snap!
but
cymplecy:
middle-click
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
dardoro
September 30, 2021, 9:10am
7
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
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?
I'll need an understanding of what the return codes are.
Edit: Oh and I want this
warped_wart_wars:
in pure Snap!
I just got dragging threshold working, so it shouldn't be too hard to get long-hold working.
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.
warped_wart_wars:
(Pro tip
Really - I had no idea.........
It's also higher quality.
My "pro tip"
Switch to dark mode and then you won't notice