{"id":13597761,"url":"https://github.com/taojy123/KeymouseGo","last_synced_at":"2025-04-10T05:33:19.324Z","repository":{"id":26645856,"uuid":"30101893","full_name":"taojy123/KeymouseGo","owner":"taojy123","description":"类似按键精灵的鼠标键盘录制和自动化操作 模拟点击和键入 | automate mouse clicks and keyboard input","archived":false,"fork":false,"pushed_at":"2025-03-20T09:55:48.000Z","size":64983,"stargazers_count":8196,"open_issues_count":99,"forks_count":1159,"subscribers_count":70,"default_branch":"master","last_synced_at":"2025-04-08T22:11:09.203Z","etag":null,"topics":["automate","keyboard","mouse","python","simulation"],"latest_commit_sha":null,"homepage":"http://taojy123.github.io/KeymouseGo","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/taojy123.png","metadata":{"files":{"readme":"README.md","changelog":"Changelog.md","contributing":null,"funding":".github/FUNDING.yml","license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null},"funding":{"github":null,"patreon":null,"open_collective":null,"ko_fi":null,"tidelift":null,"community_bridge":null,"liberapay":null,"issuehunt":null,"otechie":null,"custom":["http://taojy123.github.io/KeymouseGo/?#赞赏支持"]}},"created_at":"2015-01-31T04:16:37.000Z","updated_at":"2025-04-08T18:14:04.000Z","dependencies_parsed_at":"2024-06-19T11:22:18.677Z","dependency_job_id":"db08d020-d533-456d-873f-29bf4a7dbbb1","html_url":"https://github.com/taojy123/KeymouseGo","commit_stats":null,"previous_names":[],"tags_count":19,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taojy123%2FKeymouseGo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taojy123%2FKeymouseGo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taojy123%2FKeymouseGo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taojy123%2FKeymouseGo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/taojy123","download_url":"https://codeload.github.com/taojy123/KeymouseGo/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":248163373,"owners_count":21057922,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["automate","keyboard","mouse","python","simulation"],"created_at":"2024-08-01T17:00:40.689Z","updated_at":"2025-04-10T05:33:19.281Z","avatar_url":"https://github.com/taojy123.png","language":"Python","readme":"\u003cdiv align=\"center\"\u003e\n\n# KeymouseGo\n\n\u003cbr\u003e\n\u003cimg src=\"Preview.png\" width=\"50%\" height=\"50%\" /\u003e\n\n\u003cdiv\u003e\n    \u003cimg alt=\"platform\" src=\"https://img.shields.io/badge/platform-Windows%20%7C%20Linux%20%7C%20macOS-blueviolet\"\u003e\n\u003c/div\u003e\n\u003cdiv\u003e\n    \u003cimg alt=\"license\" src=\"https://img.shields.io/github/license/taojy123/KeymouseGo\"\u003e\n    \u003cimg alt=\"language\" src=\"https://img.shields.io/badge/python-%3E%3D%203.7-green\"\u003e\n    \u003cimg alt=\"stars\" src=\"https://img.shields.io/github/stars/taojy123/KeymouseGo?style=social\"\u003e\n\u003c/div\u003e\n\n\u003cbr\u003e\n\n[简体中文](README.md) | [English](README_en-US.md)\n\n\u003c/div\u003e\n\n功能：记录用户的鼠标键盘操作，通过触发按钮自动执行之前记录的操作，可设定执行的次数，可以理解为 `精简绿色版` 的 `按键精灵`。\n\n用途：在进行某些操作简单、单调重复的工作时，使用本软件就可以很省力了。自己只要做一遍，然后接下来就让电脑来做。\n\n\n# 目录\n\n+ [安装](#安装)\n+ [使用方法](#使用方法)\n  + [基本操作](#基本操作)\n  + [提示](#提示)\n  + [脚本语法说明](#脚本语法说明)\n+ [关于作者](#关于作者)\n+ [开源贡献者](#开源贡献者)\n\n# 安装\n\n该软件通过 `Python` 语言编写，已打包为可执行文件，未安装 `Python` 的用户可直接下载 [release](https://github.com/taojy123/KeymouseGo/releases) 版本 ，直接点击 `KeymouseGo` 运行\n\n### 源码打包可执行文件\n\n+ Windows\n```\n1. 安装 Python3\n2. pip install -r requirements-windows.txt\n3. pip install pyinstaller\n4. pyinstaller -F -w --add-data \"./assets;assets\" KeymouseGo.py\n```\n\n+ Linux或Mac\n```\n1. 安装 Python3\n2. pip3 install -r requirements-universal.txt\n3. pip3 install pyinstaller\n4. pyinstaller -F -w --add-data \"./assets:assets\" KeymouseGo.py\n```\n\n打包完成后，可执行文件在项目路径的`dist`文件夹内。\n\n# 使用方法\n\n## 基本操作\n\n### 桌面模式\n\n1、点击 `录制` 按钮，开始录制。\n\n2、在计算机上进行任意操作，如点击鼠标、键盘输入，这部分的动作会被记录下来。\n\n3、点击 `结束` 按钮，结束录制。\n\n4、点击 `启动` 按钮，计算机会重复执行一遍第2步中所录制的动作。\n\n### 命令行模式\n\n直接运行指定脚本:\n```\n\u003e ./KeymouseGo scripts/0314_1452.txt\n```\n\n运行指定脚本3次:\n```\n\u003e ./KeymouseGo scripts/0314_1452.txt -rt 3\n\u003e ./KeymouseGo scripts/0314_1452.txt --runtimes 3\n```\n\n## 提示\n\n1、可设置脚本重复执行的次数，如果为 `0` 即为无限循环。\n\n2、默认启动热键为 `F6`，功能等同于 `启动` 按钮；默认终止热键为 `F9`，按下后将会停止正在运行的脚本。\n\n3、录制时只记录鼠标点击动作和键盘动作，不记录鼠标移动轨迹。\n\n4、每次录制结束后都会在 `scripts` 目前下生成一个新的脚本文件。\n\n5、运行前可以在列表中选择一个需要执行的脚本。\n\n6、`scripts` 下的脚本文件内容可以修改，修改时可参考如下所述 `脚本格式说明`。\n\n7、热键设置中的`Middle`指代鼠标中键，`XButton`指代鼠标侧键\n\n8、由于程序速度受限，当输入的鼠标速度大于一定值时脚本将无法以预期的输入速度执行\n\n9、部分系统环境中，可能出现无法录制完整的鼠标事件的情况，请以管理员身份/root身份运行此工具即可正常使用。\n\n10、使用Mac的用户，需要确保程序在辅助功能白名单，如果使用打包的exec文件，则还需要确保终端也在辅助功能白名单。 如果app程序闪退，请尝试给予`~/.qt_material`目录下文件的写权限:\n```bash\nchmod -R 770 ~/.qt_material\n```\n\n11、对于Linux/Mac用户，如果在以管理员身份运行后仍然存在无法录制或执行的问题，可以参考[pynput的文档](https://pynput.readthedocs.io/en/latest/limitations.html)\n\n## 脚本语法说明\n\u003e 演示屏幕分辨率为`1920 * 1080`\n\n脚本为 `json5` 格式，每个最内层的jsonobject代表一个事件\n```json5\n{\n  scripts: [\n    // 开始运行 `3000ms` 后，在屏幕相对坐标 `(0.05208, 0.1852)`即 `(100,200)` 处 `按下鼠标右键`；\n    {type: \"event\", event_type: \"EM\", delay: 3000, action_type: \"mouse right down\", action: [\"0.05208%\", \"0.1852%\"]},\n    // 等待 `50ms` 后在相同位置 `抬起鼠标右键`；\n    // 横纵坐标为[-1, -1]时，表示在鼠标当前所在位置执行操作。\n    {type: \"event\", event_type: \"EM\", delay: 50, action_type: \"mouse right up\", action: [-1, -1]},\n    // 等待 `1000ms` 后 `按下f键`；\n    {type: \"event\", event_type: \"EK\", delay: 1000, action_type: \"key down\", action: [70, 'F', 0]},\n    // 等待 `50ms` 后 `抬起f键`；\n    {type: \"event\", event_type: \"EK\", delay: 50, action_type: \"key up\", action: [70, 'F', 0]},\n    // 等待 `100ms` 后，在屏幕相对坐标 `(0.2604, 0.4630)`即 `(500, 500)` 处 `按下鼠标左键`；\n    {type: \"event\", event_type: \"EM\", delay: 100, action_type: \"mouse left down\", action: [\"0.2604%\", \"0.4630%\"]},\n    // 等待 `100ms` 后，鼠标移动至相对坐标 `(0.2604, 0.5556)`即 `(500, 600)` 位置；\n    {type: \"event\", event_type: \"EM\", delay: 100, action_type: \"mouse move\", action: [\"0.2604%\", \"0.5556%\"]},\n    // 等待 `100ms` 后，在屏幕相对坐标 `(0.3125, 0.5556)`即 `(600, 600)` 处 `抬起鼠标左键`；\n    {type: \"event\", event_type: \"EM\", delay: 100, action_type: \"mouse left up\", action: [\"0.3125%\", \"0.5556%\"]},\n    // 等待 `100ms` 后，在当前位置输入 `你好 world` 文字。\n    {type: \"event\", event_type: \"EX\", delay: 100, action_type: \"input\", action: \"你好 world\"}\n  ]\n}\n```\n\n\n## 高级功能\n\n功能的使用详见[wiki](https://github.com/taojy123/KeymouseGo/wiki/文档#脚本语法)\n\n\n# 关于作者\n\n我是陶佳元，热爱代码，怀旧，在互联网上常用的 ID 有 taojy123 、tao.py。\n\n我的个人站点 [tslow.cn](https://tslow.cn) 整理并罗列了一些 `个人项目` 和 `小工具` 合集。\n\n你可以在 [简书](http://jianshu.tslow.cn) 浏览我最新发布的文章，还可以在 [B站](https://space.bilibili.com/145137942) 观看我的技术分享和生活纪实。\n\n我的邮箱: taojy123@163.com\n\n----------------------\n\n# 开源贡献者\n\n如果您是开发爱好者，并对本项目感兴趣，欢迎参与项目的共同建设，您可以通过本项目的[**dev**](https://github.com/taojy123/KeymouseGo/tree/dev)分支查看目前的进度，并且可以向本项目的[**dev**](https://github.com/taojy123/KeymouseGo/tree/dev)分支提交 Pull request 来贡献代码。\n\n在此，特别感谢积极贡献者：\n\n\u003ca href=\"https://github.com/Monomux\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/70839036?s=80\u0026v=4\" height=\"80\"\u003e\u003c/a\u003e\n\u003ca href=\"https://github.com/ZutJoe\"\u003e\u003cimg src=\"https://avatars.githubusercontent.com/u/54732130?s=80\u0026v=4\" height=\"80\"\u003e\u003c/a\u003e\n\n\n感谢 JetBrains 免费提供开发工具\n\n\u003ca href=\"https://www.jetbrains.com/?from=KeymouseGo\"\u003e\u003cimg src=\"https://raw.githubusercontent.com/taojy123/KeymouseGo/master/jetbrains-variant-2.png\" height=\"80\"\u003e\u003c/a\u003e\n","funding_links":["http://taojy123.github.io/KeymouseGo/?#赞赏支持"],"categories":["开源工具推荐","Python"],"sub_categories":["音视频相关"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaojy123%2FKeymouseGo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftaojy123%2FKeymouseGo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaojy123%2FKeymouseGo/lists"}