Hey thanks guys this really works with lr-vice!
I can map several keys to my retropad (I use a PS3 sisaxis), including the joystick swap and the virtual keyboard. I mapped Y,N,1,2,return,space,F!. Here is my configuration as an example (in the retroarch options menu):
show mapping options: on
hotkey toggle virtual: keyboard retrok_f11
hotkey switch joyports: retrok_rshift
retropad select: toggle vkbd
retropad start: retrok_rshift
retropad b: --- (=fire)
retropad a: retrok_return
retropad y: retrok_space
retropad x: retrok_f1
retropad L: retrok_1
retropad R: retrok_y
retropad L2: retrok_2
retropad R2: retrok_n
Also, if you have trouble inputting some letters in text-based games (like A or S), you must chose "physical keyboard pass-through: on" and everything will be OK.