mameau%CWD%:> █
OFFLINE
$ cat sdl-input-override.txt
SDL input override


Set the env var SDL_JOYSTICK_DEVICE before launching the SDL application to add
additional devices instead of the start search paths. Handy if you have udev 
static naming for your devices


A good example of this is Supermodel where you cannot easily set the joy devices

Running supermodel -print-inputs will output devices in standard SDL search 
paths for inputs /dev/js* /dev/input/js* /dev/input/event*

Input System Settings
---------------------

Input System: SDL

Keyboards:
 System Keyboard
Mice:
 System Mouse
Joysticks:
 1: HID 0c12:0005
 2: Twin USB Joystick
 3: Twin USB Joystick


In this example:
1 is js0, my Nubytech Arcade controller
2 is js1, 
3 is js2


But for say Scud race it would be better to configure the one of the Twin USB 
Joysticks with analogs over the arcade controller.

Supermodel assigns joystick devices automatically based on their device index

We can override that and tell it to also add additional devices, devices passed
with the env var will become SDL index 1 so if we launch supermodel as per below
we will see that the Twin USB Joystick gets listed twice

SDL_JOYSTICK_DEVICE=/dev/input/psxp1:/dev/input/psxp2

$ SDL_JOYSTICK_DEVICE=/dev/input/psxp1:/dev/input/psxp2 ./bin/supermodel -print-inputs

Input System Settings
---------------------

Input System: SDL

Keyboards:
 System Keyboard
Mice:
 System Mouse
Joysticks:
 1: Twin USB Joystick
 2: Twin USB Joystick
 3: HID 0c12:0005
 4: Twin USB Joystick
 5: Twin USB Joystick


So now our static devices are index 1 and 2 and subsequently player
1 and 2