I've searched on google for a long time now, how do I detect whether the mouse position is outside of the canvas? Once it's outside, the mouse processing stops. A key rule of my game is when a user touches the side of the screen, the game is over. An explosion along the border of the canvas is what's supposed to happen, but using the last known position of the mouse inside the canvas as the explosion point will confuse users. This is a real pain on HTML5, in spite of how easy the port of my existing game has been from C++.
If you don't know what I'm talking about, here's a link to my [unfinished] web port: http://looptil.shogun3d.net (doesn't work on Firefox, yet; use IE, Chrome or Safari).
I understand you can use the events 'mouseout' and 'mouseover' to find out when the mouse leaves the canvas and returns, but how do you get the exact position of the mouse when it's outside the canvas? This sucks. Any ideas? Thanks.