This program allows you to record mouse clicks and scrolls, and save their positions to a JSON file. You can also take a screenshot of the mouse position when recording a click.
- Python 3.x
- Dependencies:
pyautogui,pywinauto,keyboard,pynput,PIL
- Clone the repository or download the program files.
- Install the required dependencies by running the following command:
- Import the MouseClickRecorder class:
from mouse_click_recorder import MouseClickRecorder - Create a new MouseClickRecorder instance:
recorder = MouseClickRecorder() - Call the
record()method on the recorder object to start recording mouse clicks and scrolls. The recording can be stopped by pressing the "Esc" key. - The recorded positions will be saved to a JSON file called positions.json.
from mouse_click_recorder import MouseClickRecorder
recorder = MouseClickRecorder()
recorder.record() import Record_mouse_click as MC
helper = MC.MouseClickRecorder()
helper.move_mouse(json.load(open('positions.json'))) # import a list of positionsStarts recording mouse clicks and scrolls. The recording can be stopped by pressing the "Esc" key. The recorded positions will be saved to a JSON file called positions.json.
Converts a mouse position from one screen size to another.
position(x, y).: The mouse position to convert.from_size(width, height): The size of the original screen.to_size(width, height): The size of the target screen.
- The converted mouse position, in the format (x, y).
Moves the mouse to the recorded positions.
- positions (list): A list of positions to move the mouse to. Each position should be a dictionary with the keys "type" (either "click" or "scroll"), "position" (the position to move to, in the format (x, y)), and "wheel_dist" (the distance to scroll, if the type is "scroll").
Saves the recorded positions to a JSON file called positions.json.