As in the title. The more interesting case is when Plover is installed on the remote machine.
A long time ago I implement https://github.com/user202729/plover-xtest-input to capture input from xtest keyboard. Of course Plover itself uses xtest to simulate keyboard input too so this would lead to an infinite loop, so I used either https://github.com/user202729/plover-unused-xtest-output or https://github.com/user202729/plover-uinput-output (nowadays Plover itself has some rudimentary support for uinput, see #1679 , but I find it unsatisfactory, see #1707).
An alternative I can think of is to somehow inject a modified version of libxtst to the remote desktop software to make it send the key presses to Plover instead of X server directly, but that sounds somewhat difficult and flaky…