Trackball gesture detector