Yes a KVM will do the job. Another option is to use software to remote control the other computer. A Mac can control a PC via the standard Microsoft Remote Desktop Client software or you can install VNC server software on the PC, both these options would be free. A PC can control a Mac if you turn on and enable VNC sharing on the Mac.
The type of KVM you get will depend on your monitor but if possible get a DVI one (assuming your monitor support DVI) as VGA is slightly problematic on the new Mac mini. The KVM should also use USB rather than PS2 connections for the keyboard and mouse