Mouse mode handling.