KODI non CEC IR receiver configuration

Hi

I have created a “non CEC IR receiver” configuration for my KODI using this guide: https://medium.com/@ruwanka/i-built-my-r….4tccxb1u7

Everything works great, I can use my TV’s IR controller (Samsung) to navigate in KODI.

Except the following issue: If I switch to CABLE TV, KODI keeps receiving IR signals and it is navigating in background.

Is it possible to tell KODI to receive only if its content is displaying on HDMI port on TV?
Or is it possible to disable/enable IR receiver by pressing “source” button?

Any other ideas/ solutions?

Thanks
Andras