MATLAB: How to toggle ‘rotate3d’ mode in a GUI depending on whether the mouse cursor is inside or outside an axes

MATLAB

I have a GUI with an axes. I implemented the 'WindowButtonMotionFcn' callback to toggle 'rotate3d' to 'on' when the mouse cursor is inside the axes. In the same callback, I coded the function to switch back into 'rotate3d off' mode when the cursor is outside the axes,.
When I run the GUI, the cursor successfully transitions into the 'rotate3d' cursor (a circle with an arrow); however, when I exit the axes the cursor remains a rotate icon.

Best Answer

The 'WindowButtonMotionFcn' is blocked when 'rotate3d' is toggled to 'on'. As a result, automatically switching 'rotate3d' to 'off' cannot be implemented by the 'WindowButtonMotionFcn'.
There are no known workarounds besides implementing buttons to manually toggle 'rotate3d' to 'on' or 'off'.