I think a much simpler idea would to have a onmousedelta event which fires whenever the mouse moves and that tab has focus (including outside window boundary) and includes a .deltaX and .deltaY event property.
That way, the user has full control over their mouse and you can also develop fps games.