Skip to content

Commit

Permalink
fix: fixed win32 send event param
Browse files Browse the repository at this point in the history
  • Loading branch information
jlsneto committed Sep 22, 2024
1 parent 990bc61 commit d94229a
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion cereja/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,7 @@
from ._requests import request
from . import scraping

VERSION = "2.0.2.final.0"
VERSION = "2.0.3.final.0"

__version__ = get_version_pep440_compliant(VERSION)

Expand Down
4 changes: 2 additions & 2 deletions cereja/system/_win32.py
Original file line number Diff line number Diff line change
Expand Up @@ -405,7 +405,7 @@ def _click(self, button: str, position=None, n_clicks=1, interval=0.0):
position = self.position
l_param = (position[1] << 16) | position[0]

self.send_event(self._hwnd, self._mouse_messages_map[f"{button}_down"], 0, l_param)
self.send_event(self._hwnd, self._mouse_messages_map[f"{button}_down"], 1, l_param)
self.send_event(self._hwnd, self._mouse_messages_map[f"{button}_up"], 0, l_param)

def click_left(self, position: Tuple[int, int] = None, n_clicks=1):
Expand All @@ -420,7 +420,7 @@ def drag_to(self, from_, to):
from_l_param = (from_[1] << 16) | from_[0]
to_l_param = (to[1] << 16) | to[0]

self.send_event(self._hwnd, self._mouse_messages_map["left_down"], 0, from_l_param)
self.send_event(self._hwnd, self._mouse_messages_map["left_down"], 1, from_l_param)
self.send_event(self._hwnd, self._mouse_messages_map["left_up"], 0, to_l_param)
else:
self.set_position(from_[0], from_[1])
Expand Down

0 comments on commit d94229a

Please sign in to comment.