isle-portable icon indicating copy to clipboard operation
isle-portable copied to clipboard

Allow any number of joysticks to be used (make `joystickIndex` and `useJoystick` obsolete)

Open foxtacles opened this issue 6 months ago • 3 comments

Instead of relying on a joystickIndex and mapping that into the SDL available devices, I think we should follow the model I used for touch navigation: https://github.com/isledecomp/isle-portable/blob/master/LEGO1/lego/legoomni/src/input/legoinputmanager.cpp#L552

This queries all available input devices at runtime and applies any of their input states. It shoud allow all devices to be used as inputs, at any time, even when they are connected later (hotplugging)

foxtacles avatar Jun 22 '25 16:06 foxtacles

Can look into this in a couple days

Ramen2X avatar Jun 22 '25 17:06 Ramen2X

While we're at this, can we also do gamepad support, I know it's a slightly larger task but it will be needed for other platforms

JPeisach avatar Jun 28 '25 21:06 JPeisach

Should be separate tasks, gamepad will benefit from this but adding a control scheme on top bloats this task a lot.

AJenbo avatar Jun 28 '25 21:06 AJenbo

Should be solved now that gamepad has been implemented.

AJenbo avatar Jul 05 '25 20:07 AJenbo

@AJenbo I don't think this is solved? The code still uses joystick index: https://github.com/isledecomp/isle-portable/blob/master/LEGO1/lego/legoomni/src/input/legoinputmanager.cpp#L165

And I don't think it supports more than one input device either.

foxtacles avatar Jul 05 '25 20:07 foxtacles

Although to be fair I guess having multiple joystick inputs doesn't make much sense here, and it seems to have a falback if the index is invalid, so I guess it's ok

foxtacles avatar Jul 05 '25 20:07 foxtacles