Skip to content

Commit 36aac90

Browse files
WesleyMPGRMPR
authored andcommitted
Fix mouse movements capture
Mouse movements weren't captured when moving from right to left and from bottom to top. This kind of movements result in a negative distance and they were not capture due to the sensibility check, which prevents every pixel on a movement to be captured.
1 parent acc0266 commit 36aac90

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

atbswp/control.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -191,8 +191,8 @@ def isinteger(s):
191191

192192
if move == "moveTo":
193193
coordinates = [int(s) for s in parameters.split(", ") if isinteger(s)]
194-
if coordinates[0] - self._lastx < self.mouse_sensibility \
195-
and coordinates[1] - self._lasty < self.mouse_sensibility:
194+
if abs(coordinates[0] - self._lastx) < self.mouse_sensibility \
195+
and abs(coordinates[1] - self._lasty) < self.mouse_sensibility:
196196
return
197197
else:
198198
self._lastx, self._lasty = coordinates

0 commit comments

Comments
 (0)