jfernandez / ControllerTools

Game controller plugin for the Steam Deck
GNU General Public License v3.0
49 stars 3 forks source link

Feature request: Pairing mode #9

Open TiZ-HugLife opened 1 year ago

TiZ-HugLife commented 1 year ago

Hi there! This is a really nifty plugin you've made. It would make a really great one-stop shop for all sorts of controller things.

One thing that I think would be great is a pairing mode that's similar to how the Nintendo Switch handles bluetooth controller pairing, especially if you've softmodded it and added support for other consoles' controllers. If you open up the reorder controllers menu, it will attempt to pair with any bluetooth controller that is currently in pairing mode while the menu is open. Maybe this plugin could do something similar, or it may be better to have a button for it.

One thing that's kind of goofy at present with the Linux bluetooth infrastructure is that it will refuse to make a new pairing with a device it has already paired with unless you delete the device first. This can be a pretty big pain if you have a controller that moves around a lot, and that's something you definitely do have if you're a fighting game player going between multiple setups in one day.

I made a shell script that automates this process, and it could serve helpful in implementing it here if that's something you want to do. The steps it does are:

  1. It scans for four seconds and notes any new gamepad devices as well as devices it already knows that are in pairing mode.
  2. For devices it already knows, it deletes them so that on the next scan, they become "new".
  3. For new devices, it pairs with them and then saves its MAC address so that it doesn't accidentally do step 2 on them.
  4. It repeats this about twelve times to pair with devices for 48 seconds.

With a real programming language, you can probably do this more elegantly than I did, but I imagine that with the Linux bluetooth infrastructure as it currently is, there may not be a way to escape having to delete a device before re-pairing it.

Thanks for your work on this plugin. :)

jfernandez commented 1 year ago

Thank you for the detailed feature idea @HugLifeTiZ. I encourage the community to vote up this feature by commenting in the thread. We'll consider it if we see more interest.

pistolius commented 1 year ago

This would be excellent!

RobertAdams313 commented 1 year ago

Sounds like it would be a dope feature!