Handle mouse events