Preparation for mouse events.