问题描述
如果我按脚本快捷键 F12 ,
autoKey通常会停止工作
大约每70%。大约每50%的图标都会变红,而autoKey会冻结。 cpu负载略有增加。
很难说是什么原因。
脚本(gist有点大。
大约有500行,并且在github上提供。
我在将桌面录制到视频文件(youtub LKl4Ufhh3P8)时通过发送进行调试。
通过wine打开菜单(称为autoHotKey的脚本(lintalist),并捕获更改后的剪贴板并将其写出。
当我重新启动autoKey脚本时,它将运行两次(可能是三到五次)。我在各个点插入了100毫秒作为暂停。从那时起,我不必重新启动操作系统,只需在脚本冻结时将其终止即可。
知道要尝试什么吗?
为了调试,我使用了一些小助手:
import subprocess
doPopupNotify_howItWorks_counter = 0
doPopupNotify_howItWorks_firstNr = 15
doPopupNotify_howItWorks = True
def popupNotify(text):
subprocess.Popen(['notify-send',text]) # will be showed right top
def popupNotify_howItWorks(text):
global doPopupNotify_howItWorks,doPopupNotify_howItWorks_counter
if not doPopupNotify_howItWorks:
return
doPopupNotify_howItWorks_counter = doPopupNotify_howItWorks_counter + 1
if doPopupNotify_howItWorks_counter < doPopupNotify_howItWorks_firstNr:
return
subprocess.Popen(['notify-send',str(doPopupNotify_howItWorks_counter) + ") " + text]) # will be showed right top
time.sleep(.2)
系统
Operating System: Kubuntu 20.04
KDE plasma Version: 5.18.5
KDE Frameworks Version: 5.68.0
Qt Version: 5.12.8
Kernel Version: 5.4.0-52-generic
OS Type: 64-bit
autoKey gtk 0.95.10
解决方法
由于以下更改,这些问题在几天之内没有消失:
上述解决方案使用剪贴板和键盘以及通过两种脚本语言传达的Linux和Windows(葡萄酒)。
应用:
剪贴板⇄AutKey⇄AutoHotKey⇄Lintalist
错误在非封闭系统中更为常见。因此,例如,此类错误是典型的(自动键在2020:11:12仍然存在问题):
"Hotkeys get lost when triggered frequently"
-
对于使用基于Qt的桌面环境(例如KDE Plasma,Lumina等)的系统,
- 从
autokey-gtk
更改为autokey-qt
。为此存在不同的可能性(github: install using pip3)。我曾经用过:
sudo apt-get remove --auto-remove autokey-gtk
sudo apt -y install autokey-qt
- 更改了AHK-Souce
ClipboardFirst := RTrim(LTrim(Clipboard," `n`t:")," `n`t") to ClipboardFirst := RTrim(LTrim(Clipboard," `n`t`r:")," `n`t`r")
自动键图标有时仍会变为红色,但CPU负载不会增加太多,系统也不再冻结。
1:Wine是Linux上Windows的免费实现。
Kubuntu版本20.04
AutoKey版本0.95.10
Python版本3.8.5(默认值,2020年7月28日,12:59:40)[GCC 9.3.0]
酒5.0.1