Simplified Chinese | English
Function: Record the user's mouse and keyboard operations, and automatically execute the previously recorded operations by triggering the button. The number of executions can be set. It can be understood as精简绿色版
of按键精灵
.
Purpose: When performing some simple, monotonous and repetitive tasks, using this software can save effort. Just do it yourself once and let the computer do the rest.
The software is written in Python
language and has been packaged as an executable file. Users who have not installed Python
can directly download the release version and click KeymouseGo
to run it.
1. 安装 Python3
2. pip install -r requirements-windows.txt
3. pip install pyinstaller
4. pyinstaller -F -w --add-data "./assets;assets" KeymouseGo.py
1. 安装 Python3
2. pip3 install -r requirements-universal.txt
3. pip3 install pyinstaller
4. pyinstaller -F -w --add-data "./assets:assets" KeymouseGo.py
1. Click the录制
button to start recording.
2. Perform any operations on the computer, such as mouse clicks and keyboard input, and these actions will be recorded.
3. Click the结束
button to end recording.
4. Click the启动
button, and the computer will repeat the actions recorded in step 2.
Run the specified script directly:
> ./KeymouseGo scripts/0314_1452.txt
Run the specified script 3 times:
> ./KeymouseGo scripts/0314_1452.txt -rt 3
> ./KeymouseGo scripts/0314_1452.txt --runtimes 3
Run the specified script at 200% speed:
> ./KeymouseGo scripts/0314_1452.txt -sp 200
> ./KeymouseGo scripts/0314_1452.txt --speed 200
Load the custom extension MyExtension
and run the specified script:
> ./KeymouseGo scripts/0314_1452.txt -m MyExtension
> ./KeymouseGo scripts/0314_1452.txt --module MyExtension
1. You can set the number of times the script is executed repeatedly. If it is 0
it means an infinite loop.
2. The default startup hotkey is F6
, which has the same function as the启动
button; the default termination hotkey is F9
, which will stop the running script when pressed.
3. When recording, only mouse click actions and keyboard actions are recorded, and mouse movement trajectories are not recorded.
4. After each recording, a new script file will be generated under scripts
.
5. You can select a script to be executed in the list before running.
6. The content of the script file under scripts
can be modified. When modifying, please refer to脚本格式说明
below.
7. Middle
in the hotkey settings refers to the middle mouse button, XButton
refers to the side mouse button.
8. Due to the limited program speed, when the input mouse speed is greater than a certain value, the script will not be executed at the expected input speed.
In some system environments, complete mouse events may not be recorded. Please run this tool as administrator/root to use it normally.
Users using Mac need to ensure that the program is on the accessibility whitelist, and if using a packaged exec file, they also need to ensure that the terminal is also on the accessibility whitelist. If the app crashes, please try to grant write permission to the files in the ~/.qt_material
directory:
chmod -R 770 ~ /.qt_material
Demo screen resolution is
1920 * 1080
[
[3000, "EM", "mouse right down", ["0.05208%", "0.1852%"]], // 开始运行 `3000ms` 后,在屏幕相对坐标 `(0.05208, 0.1852)`即 `(100,200)` 处 `按下鼠标右键`;
[50, "EM", "mouse right up", ["0.05208%", "0.1852%"]], // 等待 `50ms` 后在相同位置 `抬起鼠标右键`;
[1000, "EK", "key down", [70, "F", 0]], // 等待 `1000ms` 后 `按下f键`;
[50, "EK", "key up", [70, "F", 0]], // 等待 `50ms` 后 `抬起f键`;
[100, "EM", "mouse left down", ["0.2604%", "0.4630%"]], // 等待 `100ms` 后,在屏幕相对坐标 `(0.2604, 0.4630)`即 `(500, 500)` 处 `按下鼠标左键`;
[100, "EM", "mouse move", ["0.2604%", "0.5556%"]], // 等待 `100ms` 后,鼠标移动至相对坐标 `(0.2604, 0.5556)`即 `(500, 600)` 位置;
[100, "EM", "mouse left up", ["0.3125%", "0.5556%"]], // 等待 `100ms` 后,在屏幕相对坐标 `(0.3125, 0.5556)`即 `(600, 600)` 处 `抬起鼠标左键`;
[100, "EX", "input", "你好 world"], // 等待 `100ms` 后,在当前位置输入 `你好 world` 文字。
]
The script is in json
format, and each line represents an action:
EM
is mouse, EK
is keyboard, and EX
is other extended actions.mouse left down
means the left mouse button is pressed, mouse left up
means the left mouse button is raised.mouse right down
means pressing the right mouse button, mouse right up
means raising the right mouse button.mouse middle down
means the middle mouse button is pressed, mouse middle up
means the middle mouse button is raised.mouse wheel up
means the mouse wheel slides up, mouse wheel down
means the mouse wheel slides down.key down
means the keyboard key is pressed down, key up
means the keyboard key is lifted up.mouse move
means the mouse slides over, and input
input text.//
on each line is the comment content.For details on how to use the function, see the wiki
I am Tao Jiayuan. I love code and nostalgia. The commonly used IDs on the Internet are taojy123 and tao.py.
My personal website tslow.cn organizes and lists some个人项目
and小工具
collections.
You can browse my latest articles on Jianshu, and you can also watch my technology sharing and life records on Station B.
My email: [email protected]
If you are a development enthusiast and are interested in this project, you are welcome to participate in the joint construction of the project. You can check the current progress through the dev branch of this project, and you can submit a Pull request to the dev branch of this project to contribute code.
Here, special thanks to active contributors:
Thanks to JetBrains for providing development tools for free
The x86
version cannot be packaged for the time being. For students with 32-bit systems, please compile the source code yourself, or download the old version v1.5 for use.
//
can be used in script files to annotate content.mouse move
event) can be recorded, and the trajectory accuracy can be set in the software. Fill in 0 to not record the trajectory. Two function points have been added for this issue(#39)
F9
hotkey at any time in command line startup mode to terminate the script.[-1, -1]
to indicate a direct click at the current position of the mouse. Because of the great obstacles encountered in compatibility with macOS, cross-platform was finally abandoned. For the history of blood and tears, please refer to these two issues: #24 moses-palmer/pynput#55
win32api
to simulate events, only supports Windows systemsshift
+上下左右
, see #27win32api
is used, there is no need to manually set the screen scaling ratio.Python3
pynput
to achieve motion capture and execution, no longer need to install pywin32
and pyhook
pynput
seems to be incompatible with WinXP and cannot package the x86
version for the time being. 后台模式
启动热键
and终止热键