process mouse events