Trackball implementation.