You're using an older version of mame that releases the mouse so it can be used by other apps when paused. Just like you used to not be able to remap the mouse when paused.
The current version of mame half releases it, so it can be used in other apps but it also works in mame while paused.
That's my guess. What version # are you using?