From 2527e1fc43d53fdef1158d9cbf194856ef46774f Mon Sep 17 00:00:00 2001 From: ikaros <327209194@qq.com> Date: Sun, 15 Oct 2023 15:04:44 +0800 Subject: [PATCH] =?UTF-8?q?=E6=8F=90=E4=BE=9B=E5=A4=9A=E6=8C=89=E9=94=AE?= =?UTF-8?q?=E6=98=A0=E5=B0=84=E7=9A=84=E9=85=8D=E7=BD=AE=E5=AE=9E=E4=BE=8B?= =?UTF-8?q?=EF=BC=9B=E4=BF=AE=E5=A4=8D=E5=A4=9A=E6=8C=89=E9=94=AE=E6=98=A0?= =?UTF-8?q?=E5=B0=84bug?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- config.json | 1 + utils/my_handle.py | 2 ++ 2 files changed, 3 insertions(+) diff --git a/config.json b/config.json index 1b30cfce..46676c0a 100644 --- a/config.json +++ b/config.json @@ -530,6 +530,7 @@ "动作1" ], "keys": [ + "ctrlleft", "1" ], "similarity": 1 diff --git a/utils/my_handle.py b/utils/my_handle.py index f2c490fa..9d583199 100644 --- a/utils/my_handle.py +++ b/utils/my_handle.py @@ -1273,6 +1273,7 @@ def key_mapping_handle(self, data): Returns: bool: 是否正常触发了按键映射事件,是True 否False """ + # 官方文档:https://pyautogui.readthedocs.io/en/latest/keyboard.html#keyboard-keys if My_handle.config.get("key_mapping", "enable"): content = data["content"] # 判断命令头是否匹配 @@ -1292,6 +1293,7 @@ def key_mapping_handle(self, data): # 触发对应按键按下释放 for key in key_mapping_config["keys"]: pyautogui.keyDown(key) + for key in key_mapping_config["keys"]: pyautogui.keyUp(key) logging.info(f'【触发按键映射】关键词:{keyword} 按键:{key_mapping_config["keys"]}')