Autokey(autokey-qt)冻结,不会插入文本

根据这里和lifehacker的一些建议,我开始使用自动键。

它效果持续了一个星期,但截至今天

  • 当我尝试输入名称新短语时挂起。

  • 当我在窗口管理器中按下’x’时,通常不会关闭

  • 不再回应我的缩写词组。

自从我上次成功尝试使用它以来,我添加了一些短语并重新启动。

另一位用户报告了gtk版autokey的类似问题。

从命令行运行它的结果似乎显示一些exception错误:

Exception in thread KeypressHandler-thread: Traceback (most recent call last): File "/usr/lib/python2.7/threading.py", line 808, in __bootstrap_inner self.run() File "/usr/lib/python2.7/dist-packages/autokey/iomediator.py", line 202, in run target.handle_keypress(rawKey, modifiers, key, windowName, windowClass) File "/usr/lib/python2.7/dist-packages/autokey/service.py", line 179, in handle_keypress currentInput, windowInfo, True) File "/usr/lib/python2.7/dist-packages/autokey/service.py", line 304, in __checkTextMatches if item.check_input(buffer, windowInfo): File "/usr/lib/python2.7/dist-packages/autokey/model.py", line 732, in check_input abbr = self._should_trigger_abbreviation(buffer) File "/usr/lib/python2.7/dist-packages/autokey/model.py", line 131, in _should_trigger_abbreviation if self.__checkInput(buffer, abbr): File "/usr/lib/python2.7/dist-packages/autokey/model.py", line 144, in __checkInput stringBefore, typedAbbr, stringAfter = self._partition_input(buffer, abbr) File "/usr/lib/python2.7/dist-packages/autokey/model.py", line 191, in _partition_input stringBefore, typedAbbr, stringAfter = currentString.rpartition(abbr) ValueError: empty separator 

完整记录在这里

任何帮助,将不胜感激。

这是我对违规代码的更改:

/usr/lib/python2.7/dist-packages/autokey/model.py

 def _should_trigger_abbreviation(self, buffer): """ Checks whether, based on the settings for the abbreviation and the given input, the abbreviation should trigger. @param buffer Input buffer to be checked (as string) """ for abbr in self.abbreviations: if abbr == "": continue if self.__checkInput(buffer, abbr): return True 

在玩了一些自动键之后,我注意到我的一个“缩写词”附加了一个逗号,并用括号括起来: [,]

经过进一步检查,此“短语”规则启用了第二个额外空白“缩写”,删除后会导致包围消失。

由于删除这个额外的空白’缩写’Autokey似乎现在运行完美。