Note: If you came here from the KansasFest presentation on this code (https://archive.org/details/2015_Kfest_Quinn_Dunki_Mouse_Programming), note that the double-click bug I talk about has been fixed. This driver should "just work" for everything you want to do.