这是一个在 Windows 上用于自动复制选中文本到剪贴板的小工具。该工具还允许通过右键单击粘贴剪贴板内容。
- 当使用鼠标选中文本时,自动将文本复制到剪贴板。
- 使用
Ctrl+A
选中文本时,自动将文本复制到剪贴板。 - 右键单击粘贴剪贴板内容。
2024.06.30:更新代码,减少生成的可执行文件的大小 38m - > 5m
2024.06.27:初步完成全功能
- Python 3.x
pyautogui
库clipboard
库pynput
库
-
克隆仓库:
git clone https://github.com/sweetorange2022/auto_copy.git cd auto-copy-tool
-
安装所需库:
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
或单独安装它们:
pip install pyautogui clipboard pynput -i https://pypi.tuna.tsinghua.edu.cn/simple
-
运行脚本:
python auto_copy.py
-
如何工作:
- 左键单击 选中文本,文本将自动复制到剪贴板。
- Ctrl+A 选中文本,文本将自动复制到剪贴板。
- 右键单击 将剪贴板内容粘贴到光标位置。
你可以使用 PyInstaller 将此脚本转换为可执行文件。
-
安装 PyInstaller:
pip install pyinstaller -i https://pypi.tuna.tsinghua.edu.cn/simple
-
构建可执行文件:
pyinstaller --onefile auto_copy.py
-
查找可执行文件: 可执行文件将位于
dist
目录中。
或者你也可以直接使用这个链接里的 Release : auto_copy 下载后双击可以直接使用
- 在使用Mobaxterm时,我注意到其软件中具备选中即自动复制和右键直接粘贴的功能。但是,这种选中自动复制的功能仅在软件内部有效。
- 由于这一功能极为便捷,我经常在软件外不自觉地尝试进行选中即复制的操作,然后意识到选中自动复制的功能仅在软件内部有效。
- 因此,我萌生了开发一个工具软件的想法,使整个系统都能实现选中即复制和右键即粘贴的功能。
欢迎贡献!请随时提交 Pull Request。
This is a simple tool for automatically copying selected text to the clipboard on Windows. The tool also allows you to paste the clipboard content by right-clicking.
- Automatically copy text to the clipboard when selected using the mouse.
- Copy text to the clipboard when selected using
Ctrl+A
. - Paste clipboard content by right-clicking.
- Python 3.x
pyautogui
libraryclipboard
librarypynput
library
-
Clone the repository:
git clone https://github.com/sweetorange2022/auto_copy.git cd auto-copy-tool
-
Install the required libraries:
pip install -r requirements.txt -i https://pypi.tuna.tsinghua.edu.cn/simple
Or install them individually:
pip install pyautogui clipboard pynput -i https://pypi.tuna.tsinghua.edu.cn/simple
-
Run the script:
python auto_copy.py
-
How it works:
- Left-click to select text, and it will be automatically copied to the clipboard.
- Ctrl+A to select all text, and it will be automatically copied to the clipboard.
- Right-click to paste the clipboard content at the cursor position.
You can convert this script into an executable file using PyInstaller.
-
Install PyInstaller:
pip install pyinstaller -i https://pypi.tuna.tsinghua.edu.cn/simple
-
Build the executable:
pyinstaller --onefile auto_copy.py
-
Find the executable: The executable will be located in the
dist
directory.
Contributions are welcome! Please feel free to submit a Pull Request.