The behavior seems to differ between Linux and Windows; have a look at http://www.mizapf.eu/files/mouse.mp4
, a screen recording I did under Linux.
mame.ini contains the settings
When I add "-mouse" to the command line (or set "mouse 1" in mame.ini), the mouse is captured (no more desktop pointer) and the values appear as shown above.
Setting "-mouse_device keyboard" makes the emulation ignore all mouse input, unless I use "-mouse" in the command line, in which case everything acts as before, including captured pointer.
I guess that the setting "-mouse_device keyboard" is intended to suppress all mouse input until the emulation is stopped, but it would be more helpful if we had a "release key" (on the partial keyboard), similar to VirtualBox. Just a suggestion, I don't know whether this is doable.