Well, almost zero windows apps can tell the difference between inputs from different keyboards; mame is one of the few. On two conditions: you enable -multikeyboard and PPJoy is seen by RawInput as a different keyboard.
Assuming the latter, after enabling -multikeyboard, you'll need to remap mame so it knows when to look for keyboard 2 B or the keyboard 1 B. Which can be a pain if the wrong keyboard is #2, since defaults are to #1 only. Without the -multikeyboard enabled, mame looks for any B key, just like 99.99% of the apps out there, IOW by default mame treats a PPJoy B & an ipac B the same.
So... three choices:
remap ipac so it doesn't share keys with ppjoy,
remap ppjoy so it doesn't shear keys with ipac, or
in mame enable -multikeyboard and remap mame.