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

feat(CompositeDeviceConfig): add udev-based source device matching #232

Merged
merged 3 commits into from
Nov 21, 2024

Conversation

ShadowApex
Copy link
Contributor

This change adds the ability to match source devices in composite device configs based on udev properties. This new matching method is the most powerful and flexible way to match input devices and could completely replace the existing evdev, hidraw, and iio match configs, but those methods will still exist to maintain backwards compatibility.

Here are some examples:

Old Method

source_devices:
  - group: gamepad
    hidraw:
      vendor_id: 0x054c
      product_id: 0x0ce6

  - group: gamepad
    blocked: true
    evdev:
      name: "{Sony Interactive Entertainment DualSense Wireless Controller,DualSense Wireless Controller}"
      vendor_id: 054c
      product_id: 0ce6
      handler: event*

New Method

source_devices:
  - group: gamepad
    udev:
      attributes:
        - name: "idVendor"
          value: "054c"
        - name: "idProduct"
          value: "0ce6"
      subsystem: "hidraw"
      
  - group: gamepad
    blocked: true
    udev:
      attributes:
        - name: "name"
          value: "{Sony Interactive Entertainment DualSense Wireless Controller,DualSense Wireless Controller}"
        - name: "id/vendor"
          value: "054c"
        - name: "id/product"
          value: "0ce6"
      sys_name: event*
      subsystem: "input"

While slightly more complex, this new method will allow us to glob match on any udev data, including attributes from udevadm info --attribute-walk /path/to/device or udev properties from udevadm info -q property /path/to/device.

@ShadowApex ShadowApex requested a review from pastaq November 21, 2024 07:24
@ShadowApex
Copy link
Contributor Author

This change also includes fixes for XBox One/Series controllers connected over bluetooth using the new udev device matching system.

@ShadowApex ShadowApex merged commit 710f7d2 into main Nov 21, 2024
2 checks passed
@ShadowApex ShadowApex deleted the shadowapex/udev-match branch November 21, 2024 22:12
Copy link

🎉 This PR is included in version 0.39.0 🎉

The release is available on:

Your semantic-release bot 📦🚀

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

Successfully merging this pull request may close these issues.

2 participants