I've just finished building my mame cabinet using Shea Silverman's PiMAME, and needed a GPIO driver for my custom keys and joystick, so I wrote one.
It has a config file in which you can define which GPIOs should emit which keyboard key sequences using uinput.
It polls and debounces the keys using about 1% of the RPi's CPU.
You can get it at https://github.com/mmoller2k/pikeyd
It's probably useful for more than just mame...