Log In  

Disconnecting then reconnecting a controller twice will break the controller support.

On handled devices it mean that PICO-8 will effectively lock the device if you put it it sleep mode twice in the same session.

I reproduced this behavior successfully on the windows, linux and raspberry pi versions.

P#84026 2020-11-09 08:29

Fixed for 0.2.2, thanks.

This was caused by a simple gotcha in SDL2 that is documented but easy to miss -- for anyone googling:

The SDL_ControllerDeviceEvent "which" field has a different meaning depending on the event:

SDL_CONTROLLERDEVICEADDED .which is the joystick index (always 0..SDL_NumJoysticks()-1)

SDL_CONTROLLERDEVICEREMOVED .which is the instance_id. Grab via SDL_JoystickInstanceID(joystick) or SDL_JoystickInstanceID(SDL_GameControllerGetJoystick(controller)) while still plugged in.

P#85646 2020-12-21 20:39 ( Edited 2020-12-21 20:40)

Thank you !

P#85680 2020-12-22 16:33

[Please log in to post a comment]

Follow Lexaloffle:          
Generated 2024-03-29 08:34:24 | 0.006s | Q:13