Skip to content

Conversation

@RetiredWizard
Copy link
Contributor

This is one of two library changes (Adafruit_USB_Host_Descriptors and Adafruit_CircuitPython_USB_Host_Mouse) that provides a framework to support combination keyboard/trackpad USB devices. A PR adafruit/Adafruit_Learning_System_Guides#3169 to the Fruit Jam PyPaint application has also been submitted which shows the use of these changes from an application perspective

This change generalizes the _find_boot_endpoint so it can locate boot or non-boot (report) endpoints. These changes are backwards compatible as the original public helper functions names haven't been changed and perform the original functions. There is a new helper function find_report_mouse_endpoint which an application can call (if no boot mice are found for example) to locate non-boot HID devices.

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

One small thing. Thanks!

@RetiredWizard RetiredWizard requested a review from tannewt December 1, 2025 19:35
Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

Thanks for the constant update. I've spotted a couple more things to fix before merging.

return mouse_interface_index, endpoint_address

elif candidate_found:
print(f"Checking Interface {mouse_interface_index}...")
Copy link
Member

Choose a reason for hiding this comment

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

Remove prints from within the library. Folks using the library won't care about them.

buf,
)
return buf
except Exception as e:
Copy link
Member

Choose a reason for hiding this comment

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

Don't catch all Exceptions. You'll get reloads and such too. You probably just want USBError.

Copy link
Member

@tannewt tannewt left a comment

Choose a reason for hiding this comment

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

Looks good! Thank you!

@tannewt tannewt merged commit 84138ca into adafruit:main Dec 3, 2025
1 check passed
adafruit-adabot pushed a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request Dec 6, 2025
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.

2 participants