We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
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
The press() and release() functions should send mouse coordinates in a report. To fix use:
diff --git a/absolute_mouse/__init__.py b/absolute_mouse/__init__.py index c67a673..4cc7615 100644 --- a/absolute_mouse/__init__.py +++ b/absolute_mouse/__init__.py @@ -40,6 +40,8 @@ class Mouse: """Middle mouse button.""" def __init__(self, devices): + self._x = 0 + self._y = 0 """Create a Mouse object that will send USB mouse HID reports. Devices can be a list of devices that includes a keyboard device or a keyboard device @@ -141,15 +143,15 @@ class Mouse: wheel -= partial_wheel # Coordinates - x = self._limit_coord(x) - y = self._limit_coord(y) + self._x = self._limit_coord(x) + self._y = self._limit_coord(y) # HID reports use little endian - self.report[1:5] = struct.pack("<HH", x, y) + self.report[1:5] = struct.pack("<HH", self._x, self._y) self._mouse_device.send_report(self.report) def _send_no_move(self): """Send a button-only report.""" - self.report[1:5] = b"\x00\x00\x00\x00" + self.report[1:5] = struct.pack("<HH", self._x, self._y) self._mouse_device.send_report(self.report) @staticmethod
The text was updated successfully, but these errors were encountered:
No branches or pull requests
The press() and release() functions should send mouse coordinates in a report. To fix use:
The text was updated successfully, but these errors were encountered: