Hacker News new | ask | show | jobs
by jabl 1638 days ago
This is a fantastic project. I'm using it with a cheap usb switch to share screen, keyboard and mouse between my work laptop and home desktop.

My only gripe is that when I press the USB switch to change inputs, I must follow with a press on the keyboard to wake up the other computer, otherwise the monitor sees that the new input has no signal and switches back to the previous input. In which case I must either manually change inputs on the screen, or press the usb switch a couple more things to try again. But I guess there's not much display-switch can do about that..

1 comments

Couldn't display-switch send a keypress (something that doesn't do much otherwise, like F15) automatically?

You could probably get that result at the moment using the external command feature and something like xdotool (on Linux)

Yes, or send a fake mouse move. It does this already when running on Windows or OSX; there's an open issue for adding the Linux host support: https://github.com/haimgel/display-switch/issues/27

I reckon it's probably 25 or 30 lines or Rust if you make it use the uinput crate to create a fake input device and send a mouse-move event that way.