a joypad @ xbmc are works with a addon but i dont know how. im using a ps3 wireless keyboard with dragball named Hama uzzano^^ ist really nice to use and is a nice small layout to work with xbmc to search something.
here a little pic of it

30 euro are not cheap but its the best board ive seen for a htpc.
to make your keyboard work in emulationstation you must delete the es_input.cfg (must be in home-emulators-retroarch folder) but im not shure, reboot and set in the startup config menu 2 or 3 controllers!! first use your keyboard and the second and third your gampad nr1 and nr2.
two controller to play are not the problem when the first pad works fine!
you must edit the retroarch.cfg in the home - emulator- retroarch folder.
edit it with wordpad or notepad c++
copy and past your working layout of the player 1 controller below.
for example
input_player1_joypad_index = "0"
input_player1_b_btn = "1"
input_player1_y_btn = "0"
input_player1_select_btn = "6"
input_player1_start_btn = "8"
input_player1_up_axis = "-1"
input_player1_down_axis = "+1"
input_player1_left_axis = "-1"
input_player1_right_axis = "+1"
input_player1_a_btn = "2"
input_player1_x_btn = "3"
input_player1_l_btn = "4"
input_player1_r_btn = "5"
now you change all the player1 comands to player2 and the input_player1_joypad_index = "0" to input_player2_joypad_index = "1" for a second pad!
for example
input_player2_joypad_index = "1"
input_player2_b_btn = "1"
input_player2_y_btn = "0"
input_player2_select_btn = "6"
input_player2_start_btn = "8"
input_player2_up_axis = "-1"
input_player2_down_axis = "+1"
input_player2_left_axis = "-0"
input_player2_right_axis = "+0"
input_player2_a_btn = "2"
input_player2_x_btn = "3"
input_player2_l_btn = "4"
input_player2_r_btn = "5"
now save the file. reboot and have fun!!