Welcome Guest, Not a member yet? Register   Sign In
Getting Mouse Position Readings
#1

[eluser]Cro_Crx[/eluser]
Hey all

I've got one of those really obscure problems that i'm sure one of you can help me out with.

I'm building some software for work to track mouse movements over a quicktime video being played back within the browser and it's going to do some calculations afterwards etc... I've got javascript working and it controls the video and I can read the position etc... it's all working dandy.

I'm up to the part where I need to log mouse co-ordinates and i'm having some issues. Bear in mind that this is going to be used internally so if it ONLY works on one browser eg... ONLY firefox3+ or ONLY webkit (chrome/safari) that's completely fine.

The problems i'm having is that in chrome, the mouse co-ordinates don't get logged when the users mouse is inside the quicktime video object. Outside of the object the co-ordinates get logged (which is a problem because i need to know the co-ordinates when inside.

So then I went to firefox3 which works well as the co-ordinates are shown while the users mouse is inside the window, although firefox3 seems to have an issue where the window offset isn't calculated correctly so the values aren't correct.

I've made an example here --> http://dev.mariovisic.com/motion-capture/example.html.

If anyone knows a way for me to get accurate readings or if you try it in your browser and it works just let me know of the browser/OS as that would really help!.

One of the ways I think it can be done is instead of using an event for the mouse logging --> $().mousemove(function(e), if there was some way to have the mouse co-ordinates log on a timer, eg every 100ms then maybe that would get around the problem i'm having in chrome? Although i'm unsure of how to get the co-ordinates without an event, or even if it can be done at all!
#2

[eluser]Cro_Crx[/eluser]
OK, after a few hours of poking around I realized that the parents element had correct offset, so I've just used that as a reference point and set it as the same size as my object Smile




Theme © iAndrew 2016 - Forum software by © MyBB