Skip to content

Commit

Permalink
Merge pull request #38 from dhalbert/mouse-report-bytes
Browse files Browse the repository at this point in the history
Convert signed mouse values to 8-bit unsigned values for report
  • Loading branch information
caternuson authored May 23, 2019
2 parents 890c4c1 + 63227d9 commit c9e0785
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions adafruit_hid/mouse.py
Original file line number Diff line number Diff line change
Expand Up @@ -144,9 +144,9 @@ def move(self, x=0, y=0, wheel=0):
partial_x = self._limit(x)
partial_y = self._limit(y)
partial_wheel = self._limit(wheel)
self.report[1] = partial_x
self.report[2] = partial_y
self.report[3] = partial_wheel
self.report[1] = partial_x & 0xff
self.report[2] = partial_y & 0xff
self.report[3] = partial_wheel & 0xff
self.hid_mouse.send_report(self.report)
x -= partial_x
y -= partial_y
Expand Down

0 comments on commit c9e0785

Please sign in to comment.