The principle and design of a 3D mouse using ultrasonic distance measurement are proposed in this paper. The system employs the method of measuring the time of flight. In addition, some techniques, including automatic gain control, self-adaptive variable threshold and temperature compensation, are also used to improve precision. According to the direct ratio between the distance and the time of flight, the distances between the transmitters on the mouse and the three receivers can be calculated. After that, the positions of the 3D mouse can be triangulated. Meanwhile, commands from the mouse buttons are detected and carried out. The validity and precision of the 3D mouse are verified by the experiment in a robot system. The proposed 3D mouse not only can be an input device in interactive 3D interface systems, but also can be used in virtual reality systems, location of robot manipulators, etc.