Turn BLE earplugs play/pause to keyboard shortcut

Hi!

I’d like to use the play/pause button on my BLE earplugs to send cmd+d shortcut, that enables/disables the microphone on Meet calls.

I had no luck with the setup so far as the play/pause keyboard trigger is exclusive for the keyboard. Any ideas how to make this work?

Thanks!