FWIW, mame is looking for 'O' or (whatever that's mapped to mame's) UI_left, then 'K' or UI_right. Joystick 1 is mapped by default to player 1 left and right and UI_left and UI_right. If you want to be able to wiggle any joystick on your 4 player CP, map all of them to mame UI_left and UI_right.
Sound like OP's default.cfg file (specifically UI_left or UI_right or both) got messed up.