I can’t change the input from a pc, only using buttons on the monitor itself. Using i2c over display port is possible to change input source but I don’t really have the will to spend time on trying it.
Incidentally, I was asked to uninstall autohotkey from my work PC because some corporate spyware detected it as a threat.
This sounds like a job for Autohotkey or a similar automation tool. It's worth learning something like this on your platform.