tangobattle / tango

Play Mega Man Battle Network online with rollback netcode!
https://tango.n1gp.net
GNU Affero General Public License v3.0
85 stars 15 forks source link

Missing instructions to connect logitech controller input on MacOS #157

Closed btruhand closed 1 year ago

btruhand commented 1 year ago

MacOS: Ventura 13.0 Processor: Quad-Core Intel Core i7 Tango version: 4.0.23

I tried playing with my logitech controller but it wasn't detected by Tango (in game or in the input setting section). I found SDL Github repo this issue https://github.com/libsdl-org/SDL/issues/5781 and saw the link to this page https://nachtimwald.com/2020/11/08/macos-iohidmanager-permission-issue/

Based on the page I had to give Tango Input Monitoring privileges which worked

Not sure where to put this kind of documentation in Tango for other users, but happy to open a PR given directions

bigfarts commented 1 year ago

This is very strange, as enabling Input Monitoring is quite a broad permission and basically enables keylogging permissions: is this only for certain types of controllers? I have a Switch Pro controller and I haven't needed to grant this.

btruhand commented 1 year ago

Ah to be precise my logitech controller is a wired one, the Gamepad F310

I made another ticket about Switch joycon but the problems there were different. Unfortunately I do not have another working controller currently to test with

bigfarts commented 1 year ago

I don't unfortunately have one of those so I'm not able to test this. Are you able to build this with https://github.com/libsdl-org/SDL/commit/172865ff137532123ec06177119be163ba1811f5 applied to see if it fixes your problem (or does it just end up not enumerating your controller?)

btruhand commented 1 year ago

Actually it seems I have misidentified the problem. It appears that Tango doesn't need Input Monitoring turned on. However what I realized is that on startup Tango won't recognize my gamepad. But it will if I plug my controller after Tango has started

I don't have knowledge of how SDL2 or experience with Rust, but it would seem that game_controller.num_joysticks() does not recognize my gamepad

Maybe a specific issue only for this gamepad? Not sure

Feel free to change the title of the issue

bigfarts commented 1 year ago

Oh, I see: it's likely because Tango tries to enumerate gamepads at startup, then will also hotplug gamepads as they are plugged in. v4.0.24 incorporates the newest SDL change which will stop the crashing at least: let me know if that works for you.

btruhand commented 1 year ago

Oh that's why it no longer crashed! Yeah Tango doesn't crash anymore on my Switch joycon when I have it connected to my macbook. Though I still can't use it. But all good for now. Hope things can be resolved in the future

Feel free to close if you feel like there's nothing else to do for the time being