If you're using win mame (or mame32), mame looks at the keyboard input through directX. Not through the normal win32, event based, method.
Do you know if the macro outputs the keypresses as a simulated keyboard device (directX should see this), or does it output them as "windows events" (ie: inserted after directX in the input data stream, so mame wouldn't see them). My guess is it's the latter.