gomita / firegestures

FireGestures, a Firefox extension.
http://www.xuldev.org/firegestures/
Other
128 stars 30 forks source link

Question on getting mouse events when context menu open #105

Open Noitidart opened 9 years ago

Noitidart commented 9 years ago

Hi there this is a great addon.

I made a small version just for rocker movements of the mouse called MouseControl: https://addons.mozilla.org/en-US/firefox/addon/mousecontrol/

I had an issue where on linux and osx, if you use right mouse down as trigger: it opens context menu on mouse down, and then future mouse wheel events and the first click event that is not inside the context menu does not come through.

I got mouse info by adding mouse event listeners to the nsIDOMWindow: https://github.com/Noitidart/MouseControl/blob/master/chrome/content/MouseControl.js#L7-L11

    window.addEventListener("wheel", MouseControl.scrollHandler, true);
    window.addEventListener("mousedown", MouseControl.downHandler, true);
    window.addEventListener("mouseup", MouseControl.upHandler, true); //the stopPropogation in upHandler is what messes up FireGestures
    window.addEventListener("click", MouseControl.clickHandler, true);
    window.addEventListener("dblclick", MouseControl.dblHandler, true);

I was wondering if your addon works around this issue and it would be awesome if you could share how you do it please.

Because for my next version I was thinking of moving to js-ctypes so that not only I get these mouse events but I also get mouse events when mouse is over various plugins like flash, pdf, etc etc. For