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"]}')