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.
An experiment around "the click"
Build a scanner from an optical mouse
Interfacing an optical mouse sensor to your Arduino
an inexpensive way to create a three dimensional pointing device