-
Notifications
You must be signed in to change notification settings - Fork 3
Trackpad #9
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
Trackpad #9
Conversation
tannewt
left a comment
There was a problem hiding this 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!
tannewt
left a comment
There was a problem hiding this 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.
adafruit_usb_host_descriptors.py
Outdated
| return mouse_interface_index, endpoint_address | ||
|
|
||
| elif candidate_found: | ||
| print(f"Checking Interface {mouse_interface_index}...") |
There was a problem hiding this comment.
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.
adafruit_usb_host_descriptors.py
Outdated
| buf, | ||
| ) | ||
| return buf | ||
| except Exception as e: |
There was a problem hiding this comment.
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.
tannewt
left a comment
There was a problem hiding this 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!
Updating https://github.com/adafruit/Adafruit_CircuitPython_USB_Host_Descriptors to 0.4.0 from 0.3.2: > Merge pull request adafruit/Adafruit_CircuitPython_USB_Host_Descriptors#9 from RetiredWizard/trackpad
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_endpointwhich an application can call (if no boot mice are found for example) to locate non-boot HID devices.