Skip to content

Convert signed mouse values to 8-bit unsigned values for report #38

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

Merged
merged 1 commit into from
May 23, 2019

Conversation

dhalbert
Copy link
Collaborator

Fixes #37. Now that we're doing bounds checking on stores in bytearrays, the values stored must be unsigned, so mask negative values to 8 bits unsigned.

@dhalbert dhalbert requested review from caternuson and a team May 23, 2019 18:14
Copy link
Contributor

@caternuson caternuson left a comment

Choose a reason for hiding this comment

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

Awesome. Thanks for jumping on this so fast.

@caternuson
Copy link
Contributor

Tested and works.

Adafruit CircuitPython 4.0.1 on 2019-05-22; Adafruit ItsyBitsy M4 Express with samd51g19
>>> from adafruit_hid.mouse import Mouse
>>> mouse = Mouse()
>>> mouse.move(y=-10)
>>> mouse.move(y=-20)
>>> mouse.move(x=-100, y=-20)
>>> 

@caternuson caternuson merged commit c9e0785 into adafruit:master May 23, 2019
adafruit-adabot added a commit to adafruit/Adafruit_CircuitPython_Bundle that referenced this pull request May 24, 2019
Updating https://github.com/adafruit/Adafruit_CircuitPython_PyPortal to 3.0.3 from 3.0.2:
  > Merge pull request adafruit/Adafruit_CircuitPython_PyPortal#35 from tannewt/group_subscr

Updating https://github.com/adafruit/Adafruit_CircuitPython_HID to 3.3.4 from 3.3.3:
  > Merge pull request adafruit/Adafruit_CircuitPython_HID#38 from dhalbert/mouse-report-bytes
  > Merge pull request adafruit/Adafruit_CircuitPython_HID#35 from schlafa/patch-1
  > Merge pull request adafruit/Adafruit_CircuitPython_HID#33 from jpecor/patch-1
@dhalbert dhalbert deleted the mouse-report-bytes branch April 8, 2025 14:17
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.

Negative mouse movement not working in CP 4.x
2 participants