Thursday, December 17, 2015

ActiveX Mouse Events with mouse position, VLC web plugin - Part 2

So, i had a task that was one of those hard to solve.

I need to use the mouse events over the activeX. I tried all the solutions in all the foruns, none this work.

Some solutions, sugest the use of one iframe over the activeX, then, make it transparent. This solution didn't  work for me, i beleave this solution work with some activeX, but not all of them, for example VLC web plugin.

In this activeX, the mouse move, click, mouseup,mousedown events, did not work. Because, none of them are exposed in the activeX. But, i tried something different, the drag, dragend, does work over this component. So, i changed the requiriments in order to implement my feature using drag events, scroll events also seem to work :).

Try the following:
window.document.body.addEventListener("drag", function(event){debugger;}, true);  //will work if dragging over the activeX and you can get the mouse position
window.document.body.addEventListener("click", function(event){debugger;}, true); //will not work over the activeX

This is a matter that is all over the web, if you have some question, just add a comment.

I'm hoping that with this, i can give a little bit back.

No comments: