A long time ago I created a custom controller configuration for my cabinet which resides in the ctrlr directory. I'm guessing this is the file I'll need to change instead of making changes inside the default.cfg. As a small example below I included a snipped of the configuration. I'm guessing I just need to swap the JOYCODE_1_YAXIS_UP_SWITCH to JOYCODE_2_YAXIS_UP_SWITCH etc.
I had to remove the opening bracket from the code snippet so it would display properly.
!-- PLAYER 1 SETUP --> port type="P1_JOYSTICK_UP"> newseq type="standard">KEYCODE_UP OR JOYCODE_1_YAXIS_UP_SWITCH /newseq> /port> port type="P1_JOYSTICK_DOWN"> newseq type="standard">KEYCODE_DOWN OR JOYCODE_1_YAXIS_DOWN_SWITCH /newseq> /port>
I don't have a section for my trackballs so I'll have to research that though.