I looked into this and think I have a solution that should work for all SDL2 apps (like the latest EmulationStation) without having to recompile SDL. Instead of patching SDL, you can apply a udev rule to configure the retrogame.c input device to look like a keyboard to SDL2. More details are in the comment here: https://github.com/adafruit/Adafruit-Retrogame/issues/5#issuecomment-50083508
The basic idea is to create the file /etc/udev/rules.d/10-retrogame.rules and add this line to it:
SUBSYSTEM==”input”, ATTRS{name}==”retrogame”, ENV{ID_INPUT_KEYBOARD}=”1″
Then restart the pi and run retrogame as normal. Try pressing the buttons in emulation station and it should register them as expected.