首页
学习
活动
专区
圈层
工具
发布
社区首页 >问答首页 >自动键( Autokey -qt)冻结,不会插入文本

自动键( Autokey -qt)冻结,不会插入文本
EN

Ask Ubuntu用户
提问于 2014-01-14 13:57:31
回答 2查看 1.5K关注 0票数 0

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

工作了一周,但到今天为止

  • 当我尝试输入名字新短语时挂起。
  • 通常情况下,当我在我的橱窗里推“x”时,它不会关闭。

  • 不再响应我的缩写短语。

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

另一个用户报告了gtk版本的自动密钥的类似问题。

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

代码语言:javascript
复制
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

原木在这里

任何帮助都将不胜感激。

EN

回答 2

Ask Ubuntu用户

回答已采纳

发布于 2014-01-15 09:00:15

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

经过进一步的检查,这条“短语”规则有第二个额外的空白“缩写”,当删除时会导致括号消失。

由于删除这个额外的空白‘缩写’自动键似乎现在运行,运行完美。

票数 0
EN

Ask Ubuntu用户

发布于 2015-11-12 12:25:25

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

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

代码语言:javascript
复制
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
票数 2
EN
页面原文内容由Ask Ubuntu提供。腾讯云小微IT领域专用引擎提供翻译支持
原文链接:

https://askubuntu.com/questions/405354

复制
相关文章

相似问题

领券
问题归档专栏文章快讯文章归档关键词归档开发者手册归档开发者手册 Section 归档