Ah, I had forgotten hdmi cec, yes. Hmmm, maybe there could be .ini or .whatever files to describe new devices and their mappings, like VID : PID and button mappings ( in whatever low level "language" or usb/bt hid button definitions are... ), like:
[1234:5678] // VID : PID
00=X // X
07=S // []...