there is a file called es_input.cfg that can be added manually (file path is /home/pi/.emulationstation I believe.):
This is for an xbox controller and a keyboard
You just have to modify the device name and buttons to match your own controller. you can type lsusb
to see what your devicename is
<?xml version="1.0"?>
<inputList>
<inputConfig type="keyboard" />
<inputConfig type="joystick" deviceName="Xbox Gamepad (userspace driver)">
<input name="a" type="button" id="4" value="1" />
<input name="b" type="button" id="5" value="1" />
<input name="down" type="button" id="1" value="1" />
<input name="left" type="button" id="2" value="1" />
<input name="menu" type="button" id="13" value="1" />
<input name="pagedown" type="button" id="11" value="1" />
<input name="pageup" type="button" id="10" value="1" />
<input name="right" type="button" id="3" value="1" />
<input name="select" type="button" id="8" value="1" />
<input name="up" type="button" id="0" value="1" />
</inputConfig>
<inputConfig type="keyboard">
<input name="a" type="key" id="13" value="1" />
<input name="b" type="key" id="8" value="1" />
<input name="down" type="key" id="274" value="1" />
<input name="left" type="key" id="276" value="1" />
<input name="menu" type="key" id="109" value="1" />
<input name="pagedown" type="key" id="281" value="1" />
<input name="pageup" type="key" id="280" value="1" />
<input name="right" type="key" id="275" value="1" />
<input name="select" type="key" id="108" value="1" />
<input name="up" type="key" id="273" value="1" />
</inputConfig>
</inputList>