Mouse
flaui.core.input.Mouse
Mouse class to simulate mouse input, wrapper over Mouse class in FlaUI.Core.Input namespace
are_buttons_swapped()
staticmethod
click(point=None, mouse_button=MouseButton.Left, post_wait=None)
staticmethod
Clicks the specified mouse button at the current location.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
point
|
Optional[Point]
|
The position to move to before clicking. |
None
|
mouse_button
|
MouseButton
|
The mouse button to click. Defaults to the left button, defaults to MouseButton.Left |
Left
|
post_wait
|
Optional[Union[bool, float, Callable[[], None]]]
|
Optional wait after operation. True=100ms, float=custom seconds, callable=custom function |
None
|
Source code in flaui/core/input.py
double_click(point=None, mouse_button=MouseButton.Left, post_wait=None)
staticmethod
Double-Clicks the specified mouse button at the current location.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
point
|
Optional[Point]
|
The position to move to before clicking. |
None
|
mouse_button
|
MouseButton
|
The mouse button to click. Defaults to the left button, defaults to MouseButton.Left |
Left
|
post_wait
|
Optional[Union[bool, float, Callable[[], None]]]
|
Optional wait after operation. True=100ms, float=custom seconds, callable=custom function |
None
|
Source code in flaui/core/input.py
down(mouse_button=MouseButton.Left, post_wait=None)
staticmethod
Sends a mouse down command for the specified mouse button.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mouse_button
|
MouseButton
|
The mouse button to press, defaults to MouseButton.Left |
Left
|
post_wait
|
Optional[Union[bool, float, Callable[[], None]]]
|
Optional wait after operation. True=100ms, float=custom seconds, callable=custom function |
None
|
Source code in flaui/core/input.py
drag(starting_point, ending_point=None, distance_x=None, distance_y=None, mouse_button=MouseButton.Left, post_wait=None)
staticmethod
Drags the mouse from starting point to ending point or by distance.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
starting_point
|
Point
|
Starting point of the drag |
required |
ending_point
|
Optional[Point]
|
Ending point of the drag (if using point-to-point drag) |
None
|
distance_x
|
Optional[int]
|
The x distance to drag, + for right, - for left |
None
|
distance_y
|
Optional[int]
|
The y distance to drag, + for right, - for left |
None
|
mouse_button
|
MouseButton
|
The mouse button to use for dragging, defaults to MouseButton.Left |
Left
|
post_wait
|
Optional[Union[bool, float, Callable[[], None]]]
|
Optional wait after operation. True=100ms, float=custom seconds, callable=custom function |
None
|
Source code in flaui/core/input.py
drag_horizontally(starting_point, distance, mouse_button=MouseButton.Left, post_wait=None)
staticmethod
Drags the mouse horizontally.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
starting_point
|
Point
|
Starting point of the drag |
required |
distance
|
int
|
The distance to drag, + for right, - for left |
required |
mouse_button
|
MouseButton
|
The mouse button to use for dragging, defaults to MouseButton.Left |
Left
|
post_wait
|
Optional[Union[bool, float, Callable[[], None]]]
|
Optional wait after operation. True=100ms, float=custom seconds, callable=custom function |
None
|
Source code in flaui/core/input.py
drag_vertically(starting_point, distance, mouse_button=MouseButton.Left, post_wait=None)
staticmethod
Drags the mouse vertically.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
starting_point
|
Point
|
Starting point of the drag |
required |
distance
|
int
|
The distance to drag, + for right, - for left |
required |
mouse_button
|
MouseButton
|
The mouse button to use for dragging, defaults to MouseButton.Left |
Left
|
post_wait
|
Optional[Union[bool, float, Callable[[], None]]]
|
Optional wait after operation. True=100ms, float=custom seconds, callable=custom function |
None
|
Source code in flaui/core/input.py
horizontal_scroll(lines, post_wait=None)
staticmethod
Simulates horizontal scrolling of the mouse wheel left or right.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lines
|
int
|
Lines to scroll horizontally |
required |
post_wait
|
Optional[Union[bool, float, Callable[[], None]]]
|
Optional wait after operation. True=100ms, float=custom seconds, callable=custom function |
None
|
Source code in flaui/core/input.py
left_click(point, post_wait=None)
staticmethod
Performs a left click.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
point
|
Optional[Point]
|
The position to move before clicking. |
required |
post_wait
|
Optional[Union[bool, float, Callable[[], None]]]
|
Optional wait after operation. True=100ms, float=custom seconds, callable=custom function |
None
|
Source code in flaui/core/input.py
left_double_click(point, post_wait=None)
staticmethod
Performs a left double click.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
point
|
Optional[Point]
|
The position to move before clicking. |
required |
post_wait
|
Optional[Union[bool, float, Callable[[], None]]]
|
Optional wait after operation. True=100ms, float=custom seconds, callable=custom function |
None
|
Source code in flaui/core/input.py
move_by(delta_x, delta_y, post_wait=None)
staticmethod
Moves the mouse by a given delta from the current position.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
delta_x
|
int
|
The delta for the x-axis |
required |
delta_y
|
int
|
The delta for y-axis |
required |
post_wait
|
Optional[Union[bool, float, Callable[[], None]]]
|
Optional wait after operation. True=100ms, float=custom seconds, callable=custom function |
None
|
Source code in flaui/core/input.py
move_to(new_x=None, new_y=None, new_position=None, post_wait=None)
staticmethod
Moves the mouse to a new position.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
new_x
|
Optional[int]
|
The new position on x-axis |
None
|
new_y
|
Optional[int]
|
The new position on y-axis |
None
|
new_position
|
Optional[Point]
|
The new position for the mouse. |
None
|
post_wait
|
Optional[Union[bool, float, Callable[[], None]]]
|
Optional wait after operation. True=100ms, float=custom seconds, callable=custom function |
None
|
Source code in flaui/core/input.py
right_click(point, post_wait=None)
staticmethod
Performs a right click.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
point
|
Optional[Point]
|
The position to move before clicking. |
required |
post_wait
|
Optional[Union[bool, float, Callable[[], None]]]
|
Optional wait after operation. True=100ms, float=custom seconds, callable=custom function |
None
|
Source code in flaui/core/input.py
right_double_click(point, post_wait=None)
staticmethod
Performs a right double click.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
point
|
Optional[Point]
|
The position to move before clicking. |
required |
post_wait
|
Optional[Union[bool, float, Callable[[], None]]]
|
Optional wait after operation. True=100ms, float=custom seconds, callable=custom function |
None
|
Source code in flaui/core/input.py
scroll(lines, post_wait=None)
staticmethod
Simulates scrolling of the mouse wheel up or down.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
lines
|
int
|
Lines to scroll |
required |
post_wait
|
Optional[Union[bool, float, Callable[[], None]]]
|
Optional wait after operation. True=100ms, float=custom seconds, callable=custom function |
None
|
Source code in flaui/core/input.py
up(mouse_button=MouseButton.Left, post_wait=None)
staticmethod
Sends a mouse up command for the specified mouse button.
Parameters:
| Name | Type | Description | Default |
|---|---|---|---|
mouse_button
|
MouseButton
|
The mouse button to press, defaults to MouseButton.Left |
Left
|
post_wait
|
Optional[Union[bool, float, Callable[[], None]]]
|
Optional wait after operation. True=100ms, float=custom seconds, callable=custom function |
None
|