Merged
Conversation
FoamyGuy
approved these changes
Sep 29, 2025
Contributor
FoamyGuy
left a comment
There was a problem hiding this comment.
Looks good to me. Thank you!
adafruit-adabot
pushed a commit
to adafruit/Adafruit_CircuitPython_Bundle
that referenced
this pull request
Sep 30, 2025
Updating https://github.com/adafruit/Adafruit_CircuitPython_USB_Host_Mouse to 1.5.0 from 1.3.1: > Merge pull request adafruit/Adafruit_CircuitPython_USB_Host_Mouse#10 from relic-se/cursor-bitmap > Merge pull request adafruit/Adafruit_CircuitPython_USB_Host_Mouse#11 from RetiredWizard/usbmousebtns
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
While adding a "chording" functionality to the minesweeper application I realized that the USB_Host_Mouse library didn't provide a way of determining if a mouse button was being held down or detecting when it is released.
By making the pressed_btns variable an accessible class property the calling application can now determine the current state of the button pushes after each call to the update method.
The start of the mouse update loop for minesweeper would be modified to the following which allows both the x,y coordinates and the current mouse button status to be monitored independently:
Edit: Without these changes, if there is no mouse data (the mouse isn't moved and the button status doesn't change) when the update method is called a value of None is returned for the button values and the current state of the buttons is lost.
Edit: If the application is only interested in capturing button pushes and not the held or released status then the return value can be used as it had been before this update.