Haven’t tried it, but the software referenced in this article (HID Macros) seems to be designed especially for this: “This is the only macro software that comes ready to use with the ability to take commands from ONE specified keyboard while ignoring another.”