Skip to content

Conversation

@RetiredWizard
Copy link
Contributor

When some mice, including the inexpensive mouse from the Adafruit shop, were used with the Match3 game, mouse movement was restricted to the X axis only and that motion was controlled by moving the mouse in the Y direction.

For some reason these mice were reading data buffers of length 8 but apparently have the data format of a 4 byte buffer read.

This PR adds logic to check 8 byte buffer reads and see if the first 50 reads from the mouse show exactly 0 movement in the Y direction. If it does, the mouse is assume to be supplying the buffer data in the 4 byte format.

The read timeout was also increased from 10 to 20 milliseconds since the 10 mSec was apparently too fast for the Adafruit mouse I was testing with.

I tested with the Adafruit Mouse as well as a cheap Logitech gaming mouse and they both worked well with these changes.

For the mice that need the data format change, the 50 reads takes a couple seconds so the mouse initially is stuck just moving left and right but once the format switches it has normal motion control.

@RetiredWizard
Copy link
Contributor Author

When a game was completed the Play again option wasn't working on the Fruit Jam because the default folder was reset to the root. I added a try/except block to catch that case and change the directory to the fruit jam default folder for the game.

Copy link
Collaborator

@FoamyGuy FoamyGuy left a comment

Choose a reason for hiding this comment

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

Thank you for the fixes!

This looks good to me. I tested successfully with the cheap USB mouse from store and confirmed the issue is fixed by this change.

@FoamyGuy FoamyGuy merged commit 7c5f4f8 into adafruit:main Nov 17, 2025
4 checks passed
@RetiredWizard RetiredWizard deleted the fruitmatch3 branch November 24, 2025 00:24
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