Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support for third party joycons and xbox orientation #116

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

lainproliant
Copy link

These two commits add the following:

  • An /etc/joycond.conf config file allowing for the following:
    • A mac_device directive allowing the device type to be overridden on a per-MAC basis. This allows the usage of third-party joycons such as the Binbok that report their device type incorrectly.
    • A prop directive allowing settings for combined joycons to be specified.
      • An xbox_orientation property swapping X/Y and A/B, making the combined controller behave more like an XBOX controller, preventing the need for remapping in many games that expect this button orientation.

Please let me know your thoughts. I included my moonlight utility lib mainly for shlex::split which is used in parsing the config file, but I can refactor this out if you'd prefer. I'm happy to follow any suggestions and make changes. Thanks for building and maintaining this awesome daemon!

This allows the use of third-party joycons like the Binbok which
misidentify themselves as Switch Pro Controllers but otherwise
work just fine.
@@ -0,0 +1,3 @@
mac_device 98:B6:E9:F8:6F:86 Left_Joycon
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This is the config file I'm currently using.

@@ -49,7 +49,7 @@ ctlr_detector_udev::ctlr_detector_udev(ctlr_mgr& ctlr_manager, epoll_mgr& epoll_
udev_mon_fd = udev_monitor_get_fd(mon);

subscriber = std::make_shared<epoll_subscriber>(std::vector({udev_mon_fd}),
[=](int event_fd){epoll_event_callback(event_fd);});
[=, this](int event_fd){epoll_event_callback(event_fd);});
Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Implicit capture of this is deprecated in C++20, so I went ahead and updated it here and other places where this is captured in lambdas.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant