Hello,
I am working on a mouse gestures web extension.
In Windows, the contextmenu event fires with mouse up. So usually my addon has a flow like this:
mousedown -> mouse gesture start
mousemove -> mouse moved = true
contextmenu -> if mouse moved then event.preventDefault()
However, in OSX and possibly Linux the contextmenu event fires with mouse down. The problem is that I don’t know if the user is starting a gesture at mouse down, so I cannot event.preventDefault() the context menu at that time.
One solution is to force OSX users to use a modifier key when performing a gesture, but that feels counterproductive. (Its a mouse gestures addon, you shouldn’t have to go to the keyboard to use it.)
Ideally, I’d like an ability to programmatically open the context menu. That way I can use event.preventDefault(), see if the user performed a gesture or not, then open the context menu if necessary.
Does anyone have any idea on how to proceed?
Thanks