You might try disabling the multi-mouse setting if it is enabled.
With multi-mouse enabled, MAME uses raw input data which might be different for a touchpad.
With it disabled, MAME uses mouse pointer data after it has been processed by windows.
At least that's the way it worked in the olden days.