diff --git a/cdp_patches/input/async_input.py b/cdp_patches/input/async_input.py index f8b43ae..86cd2a2 100644 --- a/cdp_patches/input/async_input.py +++ b/cdp_patches/input/async_input.py @@ -121,13 +121,12 @@ async def click( y: Union[int, float], pressed: str = "", emulate_behaviour: Optional[bool] = True, - timeout: Optional[float] = None, - double_down: Optional[bool] = False, + timeout: Optional[float] = None ) -> None: x, y = int(x), int(y) - await self.down(button=button, x=x, y=y, emulate_behaviour=emulate_behaviour, timeout=timeout, pressed=pressed, double_down=double_down) - if (self.emulate_behaviour and emulate_behaviour) or double_down: + await self.down(button=button, x=x, y=y, emulate_behaviour=emulate_behaviour, timeout=timeout, pressed=pressed) + if self.emulate_behaviour and emulate_behaviour: await self._sleep_timeout(timeout=timeout) await self.up(button=button, x=x, y=y, pressed=pressed) self.last_x, self.last_y = x, y @@ -141,7 +140,7 @@ async def double_click( if self.emulate_behaviour and emulate_behaviour: # await self._sleep_timeout(random.uniform(0.14, 0.21)) await self._sleep_timeout(timeout=timeout) - await self.click(button=button, x=x, y=y, emulate_behaviour=False, timeout=timeout, pressed=pressed, double_down=True) + await self.click(button=button, x=x, y=y, emulate_behaviour=False, timeout=timeout, pressed=pressed) self.last_x, self.last_y = x, y @@ -152,18 +151,14 @@ async def down( y: Union[int, float], pressed: str = "", emulate_behaviour: Optional[bool] = True, - timeout: Optional[float] = None, - double_down: Optional[bool] = False, + timeout: Optional[float] = None ) -> None: x, y = int(x), int(y) if self.emulate_behaviour and emulate_behaviour: await self.move(x=x, y=y, timeout=timeout, emulate_behaviour=emulate_behaviour, pressed=pressed) kwargs = _mk_kwargs(pressed) - if double_down: - self._base.double_down(button=button, x=x, y=y, **kwargs) - else: - self._base.down(button=button, x=x, y=y, **kwargs) + self._base.down(button=button, x=x, y=y, **kwargs) self.last_x, self.last_y = x, y async def up(self, button: Literal["left", "right", "middle"], x: Union[int, float], y: Union[int, float], pressed: str = "") -> None: diff --git a/cdp_patches/input/sync_input.py b/cdp_patches/input/sync_input.py index db4754e..6b28172 100644 --- a/cdp_patches/input/sync_input.py +++ b/cdp_patches/input/sync_input.py @@ -119,13 +119,12 @@ def click( y: Union[int, float], pressed: str = "", emulate_behaviour: Optional[bool] = True, - timeout: Optional[float] = 0.07, - double_down: Optional[bool] = False, + timeout: Optional[float] = 0.07 ) -> None: x, y = int(x), int(y) - self.down(button=button, x=x, y=y, emulate_behaviour=emulate_behaviour, timeout=timeout, pressed=pressed, double_down=double_down) - if (self.emulate_behaviour and emulate_behaviour) or double_down: + self.down(button=button, x=x, y=y, emulate_behaviour=emulate_behaviour, timeout=timeout, pressed=pressed) + if self.emulate_behaviour and emulate_behaviour: self._sleep_timeout(timeout=timeout) self.up(button=button, x=x, y=y, pressed=pressed) self.last_x, self.last_y = x, y @@ -139,7 +138,7 @@ def double_click( if emulate_behaviour and self.emulate_behaviour: # self._sleep_timeout(random.uniform(0.14, 0.21)) self._sleep_timeout(timeout=timeout) - self.click(button=button, x=x, y=y, emulate_behaviour=False, timeout=timeout, pressed=pressed, double_down=True) + self.click(button=button, x=x, y=y, emulate_behaviour=False, timeout=timeout, pressed=pressed) self.last_x, self.last_y = x, y @@ -150,17 +149,13 @@ def down( y: Union[int, float], pressed: str = "", emulate_behaviour: Optional[bool] = True, - timeout: Optional[float] = None, - double_down: Optional[bool] = False, + timeout: Optional[float] = None ) -> None: x, y = int(x), int(y) if self.emulate_behaviour and emulate_behaviour: self.move(x=x, y=y, emulate_behaviour=emulate_behaviour, timeout=timeout, pressed=pressed) - if double_down: - self._base.double_down(button=button, x=x, y=y, **_mk_kwargs(pressed)) - else: - self._base.down(button=button, x=x, y=y, **_mk_kwargs(pressed)) + self._base.down(button=button, x=x, y=y, **_mk_kwargs(pressed)) self.last_x, self.last_y = x, y def up(self, button: Literal["left", "right", "middle"], x: Union[int, float], y: Union[int, float], pressed: str = "") -> None: