I had been trying to code a project in Snap! that is a one button game, where one would hold to fly up and release to fly down, but when I was testing, I had two problems. This post is about the first problem.
When I hold, the mouse down often suddenly stops. I first didn’t know why, but when I came out of fullscreen, I realized that when I hold, sometimes it activates the right click on the stage. I don’t want to see “edit, show all, pic…, pen trails” while I’m using it!
In fact, long pressing still stops the press when viewing from the community website! What is there to right click there? A context menu doesn’t even show!
It has always been like that for mobile devices: a long-press is used for a right-click (even in Scratch). What I don’t want is that the stage can be long-pressed for a right-click.
I think if you’re in the editor view, holding on the stage should still show the right click menu because some options are useful. However, since it doesn’t show the menu in presentation mode, it shouldn’t cancel the left click (it does, which I see as a problem).
Yes, this is a touch only feature, but it’s snap emulating right click, not the os.
Currently, the only solution I found is to wiggle the mouse around slightly to make sure that Snap! doesn’t think it is a long press that is a right click. It’s slightly annoying that it has to be.
Don’t touch a screen; use the mouse only, so Snap will not be aware of touch capabilities and does not trigger long press handling.
You may modify, at runtime, the Snap instance to not show the context menu altogether, like in presentation mode.
Minimal implementation
Reload Snap to restore the menu.
And fill a future request so maybe Snap can handle this in the future.
The issue is not the menu, because even in presentation mode, right clicks (tap and hold) are srill detected. It doesn’t show the menu, but it still stops the left click detection, so <mouse down?> will be false even though your finger is still on the screen.