Skip to main content

like input tap for BlueStacks instances, but without using ADB

Project description

like input tap for BlueStacks instances, but without using ADB

pip install bstacksnoadbclick

Tested against Windows 10 / Python 3.11 / Anaconda / BlueStacks5

from bstacksnoadbclick import NoAdbClick

r"""
Class for performing clicks on BlueStacks instances without using ADB.
It creates a dummy macro and runs it (method: input_tap) using direct keystrokes (admin rights!!) to the BlueStacks window (hwnd) to activate it.

Args:
    pid (int): Process ID of the BlueStacks instance.
    macroname (str, optional): The name of the macro. Defaults to "pythonclickautomation".
    click_duration_ms (int, optional): Duration of the click in milliseconds. Defaults to 1000.
    start_ms (int, optional): Start time of the click in milliseconds. Defaults to 100.
    macro_shortcut (str, optional): Keyboard shortcut for the macro. Defaults to "F12".
    screen_width_emulator (Union[int, None], optional): Screen width of the emulator. Defaults to None.
    screen_height_emulator (Union[int, None], optional): Screen height of the emulator. Defaults to None.
    failsafe (Union[str, None], optional): Fail-safe key combination to prevent infinite loops. Defaults to None.
    with_spaces (bool, optional): Include spaces in keystrokes. Defaults to True.
    with_tabs (bool, optional): Include tabs in keystrokes. Defaults to True.
    with_newlines (bool, optional): Include newlines in keystrokes. Defaults to True.
    activate_window_before (bool, optional): Activate window before sending keystrokes. Defaults to False.
    bluestacks_programm_data (str, optional): Path to BlueStacks data directory. Defaults to r"C:\ProgramData\BlueStacks_nxt".

Raises:
    ValueError: If the shortcut is not in F-key format (e.g., F10, F12).
"""


self = NoAdbClick(
    pid=22240,
    macroname="pythonclickautomation",
    click_duration_ms=1000,
    start_ms=100,
    macro_shortcut="F12",
    screen_width_emulator=None,
    screen_height_emulator=None,
    failsafe=None,
    with_spaces=True,
    with_tabs=True,
    with_newlines=True,
    activate_window_before=False,
    bluestacks_programm_data=r"C:\ProgramData\BlueStacks_nxt",
)

r"""
Perform a tap input at the specified coordinates.

Args:
    x (int): X-coordinate of the tap.
    y (int): Y-coordinate of the tap.
    **kwargs: Additional keyword arguments for customization.

Keyword Args:
    with_spaces (bool): Include spaces in keystrokes.
    with_tabs (bool): Include tabs in keystrokes.
    with_newlines (bool): Include newlines in keystrokes.
    activate_window_before (bool): Activate window before sending keystrokes.
    json_of_already_created_dummy_macro (str): Path to the already created macro JSON file.
    screen_width_emulator (int): Screen width of the emulator.
    screen_height_emulator (int): Screen height of the emulator.
    click_duration_ms (int): Duration of the click in milliseconds.
    start_ms (int): Start time of the click in milliseconds.
    macro_shortcut (str): Keyboard shortcut for the macro.
"""
self.input_tap(300, 1000, click_duration_ms=10, start_ms=1)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

bstacksnoadbclick-0.10.tar.gz (7.7 kB view details)

Uploaded Source

Built Distribution

bstacksnoadbclick-0.10-py3-none-any.whl (9.1 kB view details)

Uploaded Python 3

File details

Details for the file bstacksnoadbclick-0.10.tar.gz.

File metadata

  • Download URL: bstacksnoadbclick-0.10.tar.gz
  • Upload date:
  • Size: 7.7 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/4.0.2 CPython/3.11.7

File hashes

Hashes for bstacksnoadbclick-0.10.tar.gz
Algorithm Hash digest
SHA256 7c0aea29fb336f03d63c44e884eb64a16621aea956be23b3d41cc1b9d63b4332
MD5 2c83257d431441ce55c765d35c33471e
BLAKE2b-256 a2f7efb3c42b3d15be1c186c463514854d5b0bafde4e03813d19a15c235943ae

See more details on using hashes here.

File details

Details for the file bstacksnoadbclick-0.10-py3-none-any.whl.

File metadata

File hashes

Hashes for bstacksnoadbclick-0.10-py3-none-any.whl
Algorithm Hash digest
SHA256 75b715eb44c416ecf7857c252816d86c4340e05ffcef31ca45f40a9848372b4a
MD5 3e74849b71b93493b3e40c6396fc142b
BLAKE2b-256 bc3c3d5c5c12d582eceea3a9c06fcdf15cd5b4f6bec2aae8eaefc951d9bbfc81

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page