“We” did something similar at meso (~10 years ago?) using VNC.
Ultra-VNC was installed on the client (the machine receiving the mouse/kb) and I believe the sender was using VNCSharp - which is no longer maintained - and @phlegma wrote the node for it iirc. It was only used to control/demo a simple desktop application provided by the client, so input-lag wasn’t that important, but most likely you wouldn’t want to play a “PC game” like this. If you want to give it a try anyways this library looks promising.
If you don’t want to install additional software on the remote machine another way might be RDP, using something like FreeRDP / FreeRDP-Sharp for example.