more refinement of mouse event handling