Rcayot
Posts: 4
Joined: Sun Jan 26, 2020 8:24 pm

Best way to share keyboard and mouse between Pi and PC

Tue May 19, 2020 3:57 pm

I would really like to not have to switch keyboards and mouse when I switch between my PC and my Pi. I have both wired (PC) and wireless (Pi) keyboard and mouse.

Any tricks I should know about? How can I get another wireless adaptor that I use with Pi to go into PC?

Roger

jamesh
Raspberry Pi Engineer & Forum Moderator
Raspberry Pi Engineer & Forum Moderator
Posts: 26378
Joined: Sat Jul 30, 2011 7:41 pm

Re: Best way to share keyboard and mouse between Pi and PC

Tue May 19, 2020 4:07 pm

I'm just started using a program called Barrier, it's available for WIndows, and is in the Pi repos. Works great. ONce keyboard/mouse over my laptop (running WIndows and Lubuntu in a VBox) and the Pi.
Principal Software Engineer at Raspberry Pi (Trading) Ltd.
Contrary to popular belief, humorous signatures are allowed.
I've been saying "Mucho" to my Spanish friend a lot more lately. It means a lot to him.

trejan
Posts: 1823
Joined: Tue Jul 02, 2019 2:28 pm

Re: Best way to share keyboard and mouse between Pi and PC

Tue May 19, 2020 4:10 pm

jamesh wrote:
Tue May 19, 2020 4:07 pm
I'm just started using a program called Barrier, it's available for WIndows, and is in the Pi repos.
Not seen that one before. Will have to give it a go. Looks like Barrier is a fork of Synergy.
What is it?

Barrier is software that mimics the functionality of a KVM switch, which historically would allow you to use a single keyboard and mouse to control multiple computers by physically turning a dial on the box to switch the machine you're controlling at any given moment. Barrier does this in software, allowing you to tell it which machine to control by moving your mouse to the edge of the screen, or by using a keypress to switch focus to a different system.

Barrier was forked from Symless's Synergy 1.9 codebase. Synergy was a commercialized reimplementation of the original CosmoSynergy written by Chris Schoeneman.

W. H. Heydt
Posts: 12320
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Best way to share keyboard and mouse between Pi and PC

Tue May 19, 2020 4:16 pm

I keep it simple, though not cheap, with a KVM switch I can share keyboard, mouse and display among several computers, of which--at the moment--4 are Pis. An alternative way to "share" would be VNC.

hippy
Posts: 7353
Joined: Fri Sep 09, 2011 10:34 pm
Location: UK

Re: Best way to share keyboard and mouse between Pi and PC

Tue May 19, 2020 4:29 pm

A poor man's KVM is a separate low-cost keyboard+mouse+VGA KVM plus domestic HDMI selector.

StephenMorton
Posts: 14
Joined: Tue May 19, 2020 4:23 pm

Re: Best way to share keyboard and mouse between Pi and PC

Tue May 19, 2020 4:37 pm

I use a Ugreen sharing switched usb hub. Four usb devices can be switched between two machines. Currently my Windows PC and Raspberry Pi. You press a button on the top to switch. It works really well. I have my Rasberry Pi branded keyboard and mouse, and a webcam running through it at the moment. I went for USB2 but USB3 models are available. For keyboards and mice it did not seem worth the extra cost. They are about £20.

I did have a full KVM switch in the days of VGA but it never seemed to work properly. And now I have multiple screens.

Best wishes, Stephen.

NimbUx
Posts: 151
Joined: Fri Jan 03, 2020 10:33 am

Re: Best way to share keyboard and mouse between Pi and PC

Tue May 19, 2020 6:33 pm

I use : x2vnc as client on the Linux/Pi side, interfacing a VNC server in the Windows PC (in my case, tightVNC). Plus autocusel on the Pi for keyboard sharing.

LTolledo
Posts: 3257
Joined: Sat Mar 17, 2018 7:29 am
Location: Anime Heartland

Re: Best way to share keyboard and mouse between Pi and PC

Tue May 19, 2020 7:53 pm

This I use:
EHD-610N.jpg
EHD-610N.jpg (44.24 KiB) Viewed 495 times

also used this before, for switching between two setups only (until I upgraded to the one above)
elecom1.jpg
elecom1.jpg (18.42 KiB) Viewed 495 times

and all the while I use RealVNC and SSH in between....
"Don't come to me with 'issues' for I don't know how to deal with those
Come to me with 'problems' and I'll help you find solutions"

Some people be like:
"Help me! Am drowning! But dont you dare touch me nor come near me!"

carphone
Posts: 14
Joined: Tue Nov 25, 2014 11:27 pm

Re: Best way to share keyboard and mouse between Pi and PC

Tue May 19, 2020 9:05 pm

Synergy (1) is awesome! I've been using it with the pi as the server and my work and personal laptop for about a year.
Cheap and works great.

deepo
Posts: 571
Joined: Sun Dec 30, 2018 8:36 pm
Location: Denmark

Re: Best way to share keyboard and mouse between Pi and PC

Tue May 19, 2020 9:34 pm

I use Barrier at work and have the Windows computer as server and my Linux as the client, as I mostly use the Windows computer and some times the Linux computer.

Barrier works by sending keyboard presses and mouse movements to the other computer when the mouse is moved to the screen(s) of the other computer. It's a configuration in the server on where which computer is in relation to the other.

So move the mouse curser to one side and it appears on the other computer and the keyboard follows the mouse.

It works fine most of the time, but if the connection fails, then your client can end up in the middle of a keystroke, which works like you are continuously pressing a key. So your client screen fills up with that key press.

My problems are probably caused by the company wifi network, so you may not experience any problems. Wifi is less solid compared to a wired network...

/Mogens

W. H. Heydt
Posts: 12320
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Best way to share keyboard and mouse between Pi and PC

Tue May 19, 2020 10:24 pm

StephenMorton wrote:
Tue May 19, 2020 4:37 pm
I use a Ugreen sharing switched usb hub. Four usb devices can be switched between two machines. Currently my Windows PC and Raspberry Pi. You press a button on the top to switch. It works really well. I have my Rasberry Pi branded keyboard and mouse, and a webcam running through it at the moment. I went for USB2 but USB3 models are available. For keyboards and mice it did not seem worth the extra cost. They are about £20.

I did have a full KVM switch in the days of VGA but it never seemed to work properly. And now I have multiple screens.
I actually have two KVM switches. One is an 8-port unit that switches PS/2 ports for mouse and keyboard plus VGA for the monitor. The other is an HDMI/USB 4-port switch. The Pis are--obviously--connected to the HDMI/USB switch. The output from that goes through an HDMI to VGA converter to one port of the PS2/VGA switch, with the USB output going through a one USB to two PS/2 adapter. It works just fine. Someday I intend to get an 8-port HDMI/USB switch. At that point, that will become the main switch and both the others will feed ports on it. The only problem being that a good 8-port HDMI/USB KVM runs about $1500, and that's not going to be in the budget for quite a while.

And just to complete the picture...sitting on top of the 8-port KVM is a 24-port GbE switch.

StephenMorton
Posts: 14
Joined: Tue May 19, 2020 4:23 pm

Re: Best way to share keyboard and mouse between Pi and PC

Wed May 20, 2020 5:29 pm

W. H. Heydt wrote:
Tue May 19, 2020 10:24 pm
StephenMorton wrote:
Tue May 19, 2020 4:37 pm
I use a Ugreen sharing switched usb hub. Four usb devices can be switched between two machines. Currently my Windows PC and Raspberry Pi. You press a button on the top to switch. It works really well. I have my Rasberry Pi branded keyboard and mouse, and a webcam running through it at the moment. I went for USB2 but USB3 models are available. For keyboards and mice it did not seem worth the extra cost. They are about £20.

I did have a full KVM switch in the days of VGA but it never seemed to work properly. And now I have multiple screens.
I actually have two KVM switches. One is an 8-port unit that switches PS/2 ports for mouse and keyboard plus VGA for the monitor. The other is an HDMI/USB 4-port switch. The Pis are--obviously--connected to the HDMI/USB switch. The output from that goes through an HDMI to VGA converter to one port of the PS2/VGA switch, with the USB output going through a one USB to two PS/2 adapter. It works just fine. Someday I intend to get an 8-port HDMI/USB switch. At that point, that will become the main switch and both the others will feed ports on it. The only problem being that a good 8-port HDMI/USB KVM runs about $1500, and that's not going to be in the budget for quite a while.

And just to complete the picture...sitting on top of the 8-port KVM is a 24-port GbE switch.
I would like to try a HDMI USB KVM switch hub. As you say they are so expensive. The price seems to go up out of proportion as you add more input ports. Difficult to justify so much money on a KVM when the Raspberry PI is such good value. Hopefully the price will come down.

User avatar
cstuettgen
Posts: 23
Joined: Wed Jan 08, 2020 6:44 pm
Location: USA, Texas
Contact: Website

Re: Best way to share keyboard and mouse between Pi and PC

Wed May 20, 2020 7:53 pm

@Stephen Morton,

I use this one in my network rack to connect to my RPi4's. Full 1080p for $75.00 I think it's pretty reasonable. :-)

https://www.amazon.com/gp/product/B07H2ZDJKW
hdmi_kvm_2.jpg
hdmi_kvm_2.jpg (97.18 KiB) Viewed 353 times
Edit: I forgot to mention it has built-in USB 2.0 hub which gets mapped to the active system, which is handy for transferring files.

irianr
Posts: 1
Joined: Thu May 21, 2020 10:55 am

Re: Best way to share keyboard and mouse between Pi and PC

Thu May 21, 2020 11:02 am

Have been using Barrier with Raspberrypi 4B and Windows 10. Found it to be very useful to cut from Windows 10 and Paste to the Raspberrypi. Only problem I have is how to active Barrier on both the Raspberrypi and the Windows 10 at startup. Has anyone succeeded?

GlowInTheDark
Posts: 560
Joined: Sat Nov 09, 2019 12:14 pm

Re: Best way to share keyboard and mouse between Pi and PC

Thu May 21, 2020 12:38 pm

What are the (substantive) differences between the (free version of) Synergy and "Barrier"?

I've been using (free) Synergy for a long time and find it quite useful. There are a few quirks (including that it is badly documented), but I've learned to live with them. Will Barrier make my life better?
GitD's list of things that are not ready for prime time:
1) IPv6
2) 64 bit OSes
3) USB 3
4) Bluetooth

deepo
Posts: 571
Joined: Sun Dec 30, 2018 8:36 pm
Location: Denmark

Re: Best way to share keyboard and mouse between Pi and PC

Thu May 21, 2020 8:30 pm

irianr wrote:
Thu May 21, 2020 11:02 am
Have been using Barrier with Raspberrypi 4B and Windows 10. Found it to be very useful to cut from Windows 10 and Paste to the Raspberrypi. Only problem I have is how to active Barrier on both the Raspberrypi and the Windows 10 at startup. Has anyone succeeded?
Yes I have - both running as a service without problems.
What's the problem you are experiencing?
Are you sure it's not a firewall problem?

/Mogens

W. H. Heydt
Posts: 12320
Joined: Fri Mar 09, 2012 7:36 pm
Location: Vallejo, CA (US)

Re: Best way to share keyboard and mouse between Pi and PC

Thu May 21, 2020 9:34 pm

cstuettgen wrote:
Wed May 20, 2020 7:53 pm
@Stephen Morton,

I use this one in my network rack to connect to my RPi4's. Full 1080p for $75.00 I think it's pretty reasonable. :-)

https://www.amazon.com/gp/product/B07H2ZDJKW

hdmi_kvm_2.jpg

Edit: I forgot to mention it has built-in USB 2.0 hub which gets mapped to the active system, which is handy for transferring files.
Here's https://www.amazon.com/CKLau-Control-Co ... B07HRBBLWN a version that handles 4K video, for not much more ($90). And an 8-port from the same company, https://www.amazon.com/CKLau-Supports-K ... B07NW3KXPW for a quite reasonable $280.

Edit to add... Something to drool over. For $400, https://www.amazon.com/CKLau-Supports-K ... B07NW3KXPW a *16*-port 4K switch.

emma1997
Posts: 761
Joined: Sun Nov 08, 2015 7:00 pm
Location: New England (not that old one)

Re: Best way to share keyboard and mouse between Pi and PC

Thu May 21, 2020 9:45 pm

At the other end of the spectrum is a ten cent DPDT slide switch. Out of several setups with Pi sharing a PC half use that and a couple with relay, button, and IR remote sensor. Both methods depend on using a keyboard/mouse USB dongle. Logitech being the most reliable with Unifying feature to allow more than one of each. That last fancy schmacy way was way over ten cents (almost one dollar, lol).

Return to “Beginners”