Can SDL send me an event for controller hot plug-in/plug-out?

I hope my SDL program can use game controller on the fly during execution. So it must have the capability to detect the hot plug-in and hot plug-out of the controller. I wish my program can be notified by means of events which can be obtained from SDL_PollEvent. Does SDL provide this type of events for controller hot plug-in/plug-out? Thanks.

Yep, see https://wiki.libsdl.org/SDL_JoyDeviceEvent (event.jdevice)

1 Like