If you are working with multiple PCs and need to use the mouse and keyboard seamlessly or if you have two PC and only one mouse and keyboard then you need to know this solution. We are talking about Linux based OSes so if you are looking for solution for any other OS this may not be the right way.
Lets say that you have two machines PC-A and PC-B where PC-A has no keyboard and mouse. You are trying to share the keyboard and mouse of PCB-B with PC-A. To make it happen both the machine needs to be connected in the network and the PC-A needs to have x2x and ssh servers installed.
apt-get install x2x openssh-server
Now in order to share your device you need to make an SSH connection to the
ssh -XC user@PC-A x2x -east -to :0.0
Here the option -east means that the remote monitor is on the east side of your host monitor, likewise you need to change the option depending your monitor position. After you are sucessfully connected just gently move your mouse towards east and watch the mouse move in your remote PC