Input Functions¶
- class autocv.core.input.Input(hwnd: int = -1)[source]¶
Bases:
Vision
Extends the Vision class with functionalities for simulating user input.
This class supports human-like mouse movements, clicks, and keyboard key presses. Randomness and delays are incorporated to mimic natural interaction.
- get_last_moved_point() tuple[int, int] [source]¶
Returns the last point where the mouse cursor was moved.
- Returns:
A tuple (x, y) representing the last moved position.
- move_mouse(x: int, y: int, *, human_like: bool = True, ghost_mouse: bool = True) None [source]¶
Moves the mouse cursor to the specified (x, y) coordinates.
The movement is relative to the client area of the target window. If human_like is True, the movement will simulate natural motion.
- Parameters:
x – The target x-coordinate.
y – The target y-coordinate.
human_like – If True, move the mouse with a human-like trajectory.
ghost_mouse – If True, use ghost mouse simulation; otherwise, directly set the cursor position.
- click_mouse(button: int = 1, *, send_message: bool = False) None [source]¶
Simulates a mouse click at the last moved position.
- Parameters:
button – The mouse button to click (1 for left, 2 for right, 3 for middle).
send_message – If True, uses SendMessage instead of PostMessage for the click.
- Raises:
None. –
- press_vk_key(vk_code: int) None [source]¶
Simulates pressing a virtual key.
- Parameters:
vk_code – The virtual key code to press.
- Raises:
None. –
- release_vk_key(vk_code: int) None [source]¶
Simulates releasing a virtual key.
- Parameters:
vk_code – The virtual key code to release.
- Raises:
None. –
- send_vk_key(vk_code: int) None [source]¶
Sends a virtual key by simulating a press and release.
- Parameters:
vk_code – The virtual key code to send.
- Raises:
None. –