The configuration file for the controllers is :
/share/system/.emulationstation/es_input.cfg
in this file you have from the beginning a basic function for the keyboard as joystick emulator.
<inputConfig type="keyboard" deviceName="Keyboard" deviceGUID="-1">
<input name="up" type="key" id="1073741906" value="1" />
<input name="down" type="key" id="1073741905" value="1" />
<input name="left" type="key" id="1073741904" value="1" />
<input name="right" type="key" id="1073741903" value="1" />
<input name="a" type="key" id="27" value="1" />
<input name="b" type="key" id="13" value="1" />
<input name="pagedown" type="key" id="34" value="1" />
<input name="pageup" type="key" id="33" value="1" />
<input name="select" type="key" id="8" value="1" />
<input name="start" type="key" id="32" value="1" />
So, if you mess it up, there is a simple way to recreate it
Just delete es_input.cfg in your /share/system/.emulationstation/ folder
and it will be automaticaly recreated from the basic es_input.cfg out of the
/share_init/system/.emulationstation/ folder at next start.
But in this case you must in general redefine your own controllers if they are not
on the list or didnt match your choice.