XBox One + Raspberry Pi – single remote?

For high WAF I’d like to have a single remote that runs my xbox one and kodi running on a pi3. The Xbox one media remote runs kodi very well but the problem is that the back button on the remote leaves the tv app and the left button on the wheel brings up the media flyout menu. Those two things make the media remote not suitable. I know there has to be a single remote option, maybe a Harmony.

Just wondering if anyone has setup a single remote setup with the xb1 and pi and wonder that that setup looks like.

Thanks