chrippa / ds4drv

A Sony DualShock 4 userspace driver for Linux
MIT License
1.05k stars 213 forks source link

Limit the number of simultaneous controllers #193

Open Benvii opened 2 years ago

Benvii commented 2 years ago

Hi, First of all thank you for this great library/module, pretty simple to use.

Use case : As a dr4drv user I would like to be able to limit the number of simultaneous controllers (in my case limit to 1 at most), but still handle disconnections (allow new controllers at disconnection if the limit isn't reached).

More context about my use case : We are using it at the DonkeyCar community to control RC Cars using PS4 controllers. I'm actually setting up a stand as part of a Makers event (called Nantes Makers Campus in France), we will let attendees play with several cars, so multiple PS4 controllers at the same time, each on connected to one rc-car. All rc-cars is running ds4drv an needs to be paired with only 1 controllers.

Implementation details :

I made a first implementation of this feature and will push a PR today, hope it's a good approach.

Thanks in advance.