From 9ff982917c28333b22a70887d54a0efa98faa536 Mon Sep 17 00:00:00 2001 From: huanghaizhen Date: Thu, 5 Sep 2024 17:24:18 +0800 Subject: [PATCH] =?UTF-8?q?input=5Fmessage=E6=96=B9=E6=B3=95=E5=A2=9E?= =?UTF-8?q?=E5=8A=A0auto=5Fbackspace=E5=8F=82=E6=95=B0?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/mouse_key.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/mouse_key.py b/src/mouse_key.py index ad6d1c6c..dfec2095 100644 --- a/src/mouse_key.py +++ b/src/mouse_key.py @@ -246,6 +246,7 @@ def input_message( interval: [int, float] = 0.2, wayland_shift: bool = False, _ydotool: bool = False, + auto_backspace: bool = True, ): """ 输入字符串 @@ -279,7 +280,8 @@ def check_chinese(): _hk.insert(1, "shift") cls.hot_key(*_hk) # 目前的方案中,粘贴内容后会在末尾会多出一个空格,临时处理:去掉末尾空格 - cls.press_key("backspace") + if auto_backspace: + cls.press_key("backspace") else: for key in message: if _ydotool: