A USB gamepad sketch for a mame cabinet I built.
Uses a Atmega32u4 Breakout Board loaded with Arduino leonardo firmware.
4x16 switch matrix enumerates as 2 gamepads (I could not get 4 to work under windows).
I don't remember which sketch I am actually using. Motherboards that supply power to USB ports even when the system is down will cause problems with this sketch (and other devices...).