Remap key combination of a specific keyboard in X11

I have a graphics tablet, which emulates a keyboard for its hardware keys. For example, it sends Ctrlz for the key that is meant to be used as undo. I would like to remap these keys.

There are many howtos for remapping keys from all keyboards. But they neither cover remapping keys from only a specific keyboard nor remapping keys that send combinations. For example, I would like to map the Ctrlz combination to a single letter like a.

What is the best way to create a mapping, which only applies to one “keyboard” and can override key combinations?