views:

23

answers:

0

PPK at quirksmode.org says,

Sometimes the mousemove event continues firing even if the mouse does not move. This is not a browser bug, but an OS or maybe even hardware bug. Some optical mice keep on sending mousemove interrupts, even though they aren't moved.

In general this bug is easy to work around: just check the mouse position before doing anything (and you want to check the mouse position in just about any mousemove script, anyway.)

I'm experiencing this in various QA environments. I'm trying to load the last position, but in Safari that appears to be fired in loop over an array last positions, so I can't seem to detect it reliably, per PPK's suggestion.

My thought right now is to attach a function to the mousemove event to pause that event for 3 seconds. Then if the user, or the browser/OS/hardware/user/ghost moves the mouse after 3 seconds, the event would be detected.

I'm using the YUI, but any hint would be appreciated for an attack. I've looked at some of the examples in other posts, but they seem to remove the mousemove event from the element and I need it reset a idle timer, but I don't need it 30 times/second.

Much thanks!