Yeah, a KVM switch would do that. They come in configurations from two computers to dozens of ports. Can't guaranty there is one out there that works with a mouse click, some have keyboard short cuts, some have buttons you select, but there may be one that does mice clicks.
They are very common in server rooms so that you have a rack of computers and control them with one keyboard, one video and one mouse.