Handle mouse clicks and movements