ShareMouse. But when the desktop PC is off i need a way to rapidly switch the keyboard and mouse to control the MacBook which is also connected to second 27 inch screen.
So, I've connected the KVM switch to MacBook using an PS/2toUSB adapter and all went fine. Then I decided to switch on desktop PC that is running Microsoft Windows 8 in order to check that everything works as expected... but I found a bad surprise. The KVM switch is very old and has only PS/2 connectors so I've connected it to the standard PS/2 ports of my motherboard but Windows 8 was not recognizing it. So I've rebooted and entered to BIOS management just to see if the KVM switch was the problem. But in the BIOS the keyboard functioned perfectly.
Well, the problem was Windows ( ah! ) and I discovered, thanks to this answer in the Microsoft Community, that Windows 8 disables the PS/2 keyboards and mouse (or simply the ports) when only a USB keyboard is connected.
In order to get things restored, you have to manually edit the registry changing a key (obviously using another keyboard and mouse!! :) ) in order to re-enable the PS/2 ports service.
The key to edit is "HKEY_LOCAL_MACHINE\SYSTEM\CurrentControlSet\Services\i8042prt" and the value of the property "StartValue" must be set to "1" (hex). Once done, connect your PS/2 stuff and reboot and all should work properly.
Hope this help.