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

:: zep

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)
:: choo-t

Thank you !

P#85680 2020-12-22 16:33

[Please log in to post a comment]

Follow Lexaloffle:        
Generated 2021-03-06 11:00 | 0.010s | 2097k | Q:17