htrefil / rkvm

Virtual KVM switch for Linux machines
MIT License
386 stars 50 forks source link

Retry `SendInput` after switching desktops upon initial failure #21

Closed h4ssi closed 1 year ago

h4ssi commented 3 years ago

When Windows UAC is active, SendInput fails because "the UAC desktop is in focus" (blocking events on the original desktop).

As a initial work around for this use case, the desktop is switched and the SendInput is retried.

To be able to do this, the process needs to run with sufficient privileges to access the UAC desktop.

There are several ways to do this. One example is the psexec tool (you may need to use absolute paths - even in the config):

psexec -sid client ...

I am not sure whether this simple "retry once" strategy is sufficient or a more sophisticated approach is required.