类似按键精灵的鼠标键盘录制和自动化操作 模拟点击和键入 | automate mouse clicks and keyboard input
KeymouseGo版本: v5.2.1
🔗更新日志
  • 修复当按键字符为热键字符串的一部分时,该按键无法被录制的问题 #337 #328

本次构建使用的python版本为python3.10,对于python3.10不支持的系统(如windows 7),可以手动打包或是修改release.yml通过github action用更低版本的python构建,32位版本程序同理。

KeymouseGo版本: v5.2
🔗更新日志
  • 升级到PySide6 https://github.com/taojy123/KeymouseGo/pull/234
  • 启用高 DPI 缩放 in https://github.com/taojy123/KeymouseGo/pull/300
  • 新的插件系统,不兼容旧版插件
  • 脚本格式改用json5,用于更好地编写脚本以及支持插件功能,兼容旧版脚本
  • UI和脚本执行逻辑重构
  • 自定义热键 #313(支持组合键)。相应的,ctrlshiftaltwin/start/cmd无法单独用作热键。
  • 翻译错误。#289 #299
  • 移除原本程序的执行速度,可参考wiki的样例2编写插件作为功能替代。
  • github action添加对linux-arm64的构建
  • 程序界面显示当前鼠标坐标#236

能力有限,没有做mac和linux-arm64下的测试。本次对底层的改动较大,如果遇到bug,欢迎提交issue 本次构建使用的python版本为python3.10,对于python3.10不支持的系统(如windows 7),可以手动打包或是修改release.yml通过github action用更低版本的python构建,32位版本程序同理。

KeymouseGo版本: v5.1.1
🔗更新日志

v5.1.1

Fixed bugs:

  • 鼠标中键无法触发热键功能 #184
  • 打包GUI程序报错 #194
  • 无法在命令行状态下运行 #190

可执行程序均通过Github Action打包: Original-link app版本(mac)打包来自:Original-link

KeymouseGo版本: v5.1
🔗更新日志

v5.1

  • 支持在Linux和Mac环境下运行
  • 支持在多屏环境下运行(仅Windows)
  • 修复程序在执行连点操作时有概率崩溃的问题
  • 修复文件选择器选择脚本后选项卡未更新的问题

v5.0

  • 初步实现自定义扩展功能
  • 可调整提示音音量
  • 增加脚本重命名/编辑子窗口
  • 添加英文文档
  • 增加简单日志窗口
  • 适应高分辨率(在高分辨率情况下放大窗口)

如果使用下载时报毒请忽视,不放心的也可以自己 clone 项目后用 pyinstaller 打包。( https://github.com/taojy123/KeymouseGo/issues/22 )

KeymouseGo版本: v5.0
🔗更新日志

v5.0

  • 初步实现自定义扩展功能
  • 可调整提示音音量
  • 增加脚本重命名/编辑子窗口
  • 添加英文文档
  • 增加简单日志窗口
  • 适应高分辨率(在高分辨率情况下放大窗口)

如果使用下载时报毒请忽视,不放心的也可以自己 clone 项目后用 pyinstaller 打包。( https://github.com/taojy123/KeymouseGo/issues/22 )

带有-upx后缀的为使用开源软件upx压缩后的程序

KeymouseGo


platform
license language stars

简体中文 | English

Features:

  • Record mouse/keyboard operations
  • Reproduce operations recorded before
  • Can be regarded as simplified Quick Macro

Usage:

  • Free users away from works that are simple and repetitive
  • You can record the necessary operations once and left the rest of works to computer

Table of content

Installation

This program is written in Python and packed as executable file. You can download release version directly without installation of Python.

Bundle with source code

  • Windows
1. Install Python 3
2. pip install -r requirements-windows.txt
3. pip install pyinstaller
4. pyinstaller -F -w --add-data "./assets;assets" KeymouseGo.py
  • Linux or Mac
1. Install Python 3
2. pip3 install -r requirements-universal.txt
3. pip3 install pyinstaller
4. pyinstaller -F -w --add-data "./assets:assets" KeymouseGo.py

The executable program would appear at folder your_poject_location/dist.

Usage

Basic operation

Desktop mode

  1. Click Record button to start recording

  2. Do anything like clicking mouse or tapping keyboard, which will be recorded

  3. Click Finish button to stop recording

  4. Click Launch button to reproduce the operation recorded in step 2

Command line mode

Run specific script

> ./KeymouseGo scripts/0314_1452.txt

Run specific script for 3 times

> ./KeymouseGo scripts/0314_1452.txt -rt 3
> ./KeymouseGo scripts/0314_1452.txt --runtimes 3

Tips

  1. The program will endlessly run the script if run times is set to 0

  2. The default launch hotkey is F6, which functions the same as the launch button. The default stop hotkey is F9, which will terminate the running script

  3. Only mouse click operation and keyboard operation will be recorded. Mouse trail won't be recorded.

  4. A new script file will be generated in directory scripts at the end of recording.

  5. You can choose the script to run in choice list.

  6. The content of script can be edited with reference of Grammar of script.

  7. In hotkey setting, Middle refers mouse middle button and XButton refers mouse side button.

  8. Due to the limitation of execution speed, the running speed cannot be set too high.

  9. In some system environment, there may be circumstances that the mouse events cannot be fully recorded. To settle this, you can run this program as administrator/root.

  10. For mac users, make sure that application must be white listed under Enable access for assistive devices. You may also need to whitelist terminal application if running from terminal. If the app crashes, you may try to give write permission for directory ~/.qt_material.

chmod -R 770 ~/.qt_material
  1. For Linux/Mac users, if you have problems recording or executing event after running this program as root, you may refer to documentation of pynput

Grammar of scripts

Assume that the resolution of screen is 1920 * 1080

The script is saved in json5 format, in which each line represents an event

{
  scripts: [
    // Press mouse right button at the relative coordinates `(0.05208, 0.1852)`(i.e. absolute coordinates `(100,200)`) after 3000ms
    {type: "event", event_type: "EM", delay: 3000, action_type: "mouse right down", action: ["0.05208%", "0.1852%"]},
    // Release mouse right button at the coordinates after 50ms
    // The mouse event will execute on the position that the cursor is currently in when the coordinate is set to [-1, -1]
    {type: "event", event_type: "EM", delay: 50, action_type: "mouse right up", action: [-1, -1]},
    // Press key 'f' after 1000ms
    {type: "event", event_type: "EK", delay: 1000, action_type: "key down", action: [70, 'F', 0]},
    // Release key 'f' after 50ms
    {type: "event", event_type: "EK", delay: 50, action_type: "key up", action: [70, 'F', 0]},
    // Press mouse left button at the relative coordinates `(0.2604, 0.4630)`(i.e. absolute coordinates `(500,500)`) after 100ms
    {type: "event", event_type: "EM", delay: 100, action_type: "mouse left down", action: ["0.2604%", "0.4630%"]},
    // Move mouse to the relative coordinates `(0.2604, 0.4630)`(i.e. absolute coordinates `(500,500)`) after 100ms
    {type: "event", event_type: "EM", delay: 100, action_type: "mouse move", action: ["0.2604%", "0.5556%"]},
    // Release mouse left button at the relative coordinates `(0.3125, 0.5556)`(i.e. absolute coordinates `(600,600)`) after 100ms
    {type: "event", event_type: "EM", delay: 100, action_type: "mouse left up", action: ["0.3125%", "0.5556%"]},
    // Input 'Hello world' at current coordinate after 100ms
    {type: "event", event_type: "EX", delay: 100, action_type: "input", action: "你好 world"}
  ]
}
  • It is recommended to back up script before editing. And make sure to follow the format while editing, otherwise it may result in failure of execution.

Advanced Operations

Please check wiki

About me

I'm Tao Jiayuan, with commonly used id taojy123, tao.py on Internet

My personal site tslow.cn organizes and lists a collection of 'personal projects' and 'gadgets'.

You can refer my newly published articles on jianshu and watch my technology sharing and life documentary on bilibili

My Email: taojy123@163.com


Contributors

Contributors

If you are a developer and interested in this project, you can check the progress in branch dev. and you are welcomed to participating by opening pull request to branch dev.

Thanks to free develop tool provided by JetBrains