Synergy is Free and Open Source Software that lets you easily share your mouse and keyboard between multiple computers, where each computer has it's own display. No special hardware is required, all you need is a local area network. Synergy is supported on Windows, Mac OS X and Linux.
The proCONTROLL library allows Processing to communicate with controll devices like joysticks, joypads but also keyboards and mice.