Compare commits
No commits in common. "master" and "V1.0.0" have entirely different histories.
48
README.md
48
README.md
@ -1,47 +1,3 @@
|
|||||||
# 按键监听一键开火工具
|
# cgh_keyboard_fire_tool
|
||||||
|
|
||||||
允许监听键盘事件进行一键开火,基于 [CGH](https://github.com/hyperzlib/DG-Lab-Coyote-Game-Hub)
|
监听指定按键一键开火
|
||||||
|
|
||||||
## 开始使用
|
|
||||||
|
|
||||||
1. 在[版本发布](https://gitea.miri.site/Mr_Fang/cgh_keyboard_fire_tool/releases)中找到最新版本,或[点击此处打开最新发布](https://gitea.miri.site/Mr_Fang/cgh_keyboard_fire_tool/releases/latest),下载文件附件中的 `Keyboard_Fire_Tool_V***.exe`
|
|
||||||
|
|
||||||
2. 启动 [Coyote-Game-Hub](https://github.com/hyperzlib/DG-Lab-Coyote-Game-Hub) 服务器(可参照 README 文档进行)
|
|
||||||
|
|
||||||
3. 在 CGH 中连接郊狼主机/客户端,获取连接码
|
|
||||||
|
|
||||||
4. 启动本工具,填写连接码并配置按键事件,开始监听即可
|
|
||||||
|
|
||||||
5. 可使用菜单“文件”中的“保存配置”和“读取配置”保存/读取 `.json` 格式的配置文件([示例配置文件](https://gitea.miri.site/Mr_Fang/cgh_keyboard_fire_tool/src/branch/master/example.json))
|
|
||||||
|
|
||||||
## 注意事项
|
|
||||||
|
|
||||||
**停止监听可能并不能完全注销热键,若出现此情况,建议保存当前配置后重新启动程序**
|
|
||||||
|
|
||||||
## 进入开发
|
|
||||||
|
|
||||||
1. 克隆本仓库到本地
|
|
||||||
|
|
||||||
```shell
|
|
||||||
git clone https://gitea.miri.site/Mr_Fang/cgh_keyboard_fire_tool.git
|
|
||||||
```
|
|
||||||
|
|
||||||
2. 初始化开发环境
|
|
||||||
|
|
||||||
```shell
|
|
||||||
pip install -r requirements.txt
|
|
||||||
```
|
|
||||||
|
|
||||||
3. 作出修改
|
|
||||||
|
|
||||||
4. 使用 PyInstaller 构建可执行文件
|
|
||||||
|
|
||||||
```shell
|
|
||||||
pyinstaller --clean --noconfirm main.spec
|
|
||||||
```
|
|
||||||
|
|
||||||
5. 在 `./dist/` 下即可找到构建产物
|
|
||||||
|
|
||||||
## 开源许可
|
|
||||||
|
|
||||||
本工具使用 [Apache License 2.0](https://choosealicense.com/licenses/apache-2.0/) 开源许可协议
|
|
19
example.json
19
example.json
@ -1,19 +0,0 @@
|
|||||||
{
|
|
||||||
"connection_code": "",
|
|
||||||
"key_settings": [
|
|
||||||
{
|
|
||||||
"key_combo": "space",
|
|
||||||
"strength": 10,
|
|
||||||
"time": 5000,
|
|
||||||
"pulseid": "",
|
|
||||||
"override": true
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"key_combo": "shift",
|
|
||||||
"strength": 10,
|
|
||||||
"time": 5000,
|
|
||||||
"pulseid": "ec329704",
|
|
||||||
"override": false
|
|
||||||
}
|
|
||||||
]
|
|
||||||
}
|
|
11
main.py
11
main.py
@ -338,10 +338,10 @@ def stop_monitor():
|
|||||||
if monitor_thread:
|
if monitor_thread:
|
||||||
monitor_thread.stop()
|
monitor_thread.stop()
|
||||||
monitor_thread = None
|
monitor_thread = None
|
||||||
btn_start["state"] = "normal"
|
btn_start["state"] = "disabled"
|
||||||
btn_stop["state"] = "disabled"
|
btn_stop["state"] = "disabled"
|
||||||
lbl_status["text"] = "等待开始监听..."
|
lbl_status["text"] = "等待关闭程序,关闭程序后才可彻底取消监听..."
|
||||||
messagebox.showinfo("提示", "已停止监听,\n若无法取消监听建议保存配置后重启软件")
|
messagebox.showinfo("提示", "必须手动关闭本程序才可取消监听!")
|
||||||
|
|
||||||
|
|
||||||
def save_config():
|
def save_config():
|
||||||
@ -412,10 +412,7 @@ filemenu.add_command(label="保存配置", command=save_config)
|
|||||||
filemenu.add_command(label="读取配置", command=load_config)
|
filemenu.add_command(label="读取配置", command=load_config)
|
||||||
menubar.add_cascade(label="文件", menu=filemenu)
|
menubar.add_cascade(label="文件", menu=filemenu)
|
||||||
aboutmenu = tk.Menu(menubar, tearoff=0)
|
aboutmenu = tk.Menu(menubar, tearoff=0)
|
||||||
aboutmenu.add_command(label="使用教程",
|
aboutmenu.add_command(label="开源",
|
||||||
command=lambda: webbrowser.open("https://gitea.miri.site/Mr_Fang/cgh_keyboard_fire_tool"
|
|
||||||
"/src/branch/master/README.md"))
|
|
||||||
aboutmenu.add_command(label="开源仓库",
|
|
||||||
command=lambda: webbrowser.open("https://gitea.miri.site/Mr_Fang/cgh_keyboard_fire_tool"))
|
command=lambda: webbrowser.open("https://gitea.miri.site/Mr_Fang/cgh_keyboard_fire_tool"))
|
||||||
menubar.add_cascade(label="帮助", menu=aboutmenu)
|
menubar.add_cascade(label="帮助", menu=aboutmenu)
|
||||||
root.config(menu=menubar)
|
root.config(menu=menubar)
|
||||||
|
39
main.spec
39
main.spec
@ -1,39 +0,0 @@
|
|||||||
# -*- mode: python ; coding: utf-8 -*-
|
|
||||||
|
|
||||||
VERSION = "1.0.1"
|
|
||||||
|
|
||||||
a = Analysis(
|
|
||||||
['main.py'],
|
|
||||||
pathex=[],
|
|
||||||
binaries=[],
|
|
||||||
datas=[],
|
|
||||||
hiddenimports=[],
|
|
||||||
hookspath=[],
|
|
||||||
hooksconfig={},
|
|
||||||
runtime_hooks=[],
|
|
||||||
excludes=[],
|
|
||||||
noarchive=False,
|
|
||||||
optimize=0,
|
|
||||||
)
|
|
||||||
pyz = PYZ(a.pure)
|
|
||||||
|
|
||||||
exe = EXE(
|
|
||||||
pyz,
|
|
||||||
a.scripts,
|
|
||||||
a.binaries,
|
|
||||||
a.datas,
|
|
||||||
[],
|
|
||||||
name=f'Keyboard_Fire_Tool_V{VERSION}',
|
|
||||||
debug=False,
|
|
||||||
bootloader_ignore_signals=False,
|
|
||||||
strip=False,
|
|
||||||
upx=True,
|
|
||||||
upx_exclude=[],
|
|
||||||
runtime_tmpdir=None,
|
|
||||||
console=False,
|
|
||||||
disable_windowed_traceback=False,
|
|
||||||
argv_emulation=False,
|
|
||||||
target_arch=None,
|
|
||||||
codesign_identity=None,
|
|
||||||
entitlements_file=None,
|
|
||||||
)
|
|
Loading…
x
Reference in New Issue
Block a user