Classification:
Bug
Reproducibility:
Almost every day after few hours of use.
Summary
I have noticed that Autokey just stops expanding after some time has passed (usually hours). It has baffled me for weeks and I've basically resorted to restarting it once it stopped working. Finally today, I spent some time trying to track down the issue and have started Autokey from the command line with verbose argument.
Every now and then, I'd try Autokey and see if it still expanded. After a while, Autokey stopped working and I checked the output. This is what I saw when I tried to expand the "expansion1" phrase that I setup earlier:
2017-08-13 10:21:29,843 DEBUG - service - Raw key: '<backspace>', modifiers: [], Key: <backspace>
2017-08-13 10:21:29,843 DEBUG - service - Window visible title: b'~/Documents/Text/test.txt \xe2\x80\xa2 - Sublime Text', Window class: 'subl3.Subl3'
2017-08-13 10:21:29,843 DEBUG - service - No phrase/script matched hotkey
2017-08-13 10:21:30,085 DEBUG - service - Raw key: 'a', modifiers: [], Key: E
2017-08-13 10:21:30,085 DEBUG - service - Window visible title: b'~/Documents/Text/test.txt \xe2\x80\xa2 - Sublime Text', Window class: 'subl3.Subl3'
2017-08-13 10:21:30,085 DEBUG - service - No phrase/script matched hotkey
2017-08-13 10:21:30,085 DEBUG - service - Input stack at end of handle_keypress: deque(['E'], maxlen=150)
2017-08-13 10:21:30,268 DEBUG - service - Raw key: 'p', modifiers: [], Key: X
2017-08-13 10:21:30,268 DEBUG - service - Window visible title: b'~/Documents/Text/test.txt \xe2\x80\xa2 - Sublime Text', Window class: 'subl3.Subl3'
2017-08-13 10:21:30,268 DEBUG - service - No phrase/script matched hotkey
2017-08-13 10:21:30,269 DEBUG - service - Input stack at end of handle_keypress: deque(['E', 'X'], maxlen=150)
2017-08-13 10:21:30,455 DEBUG - service - Raw key: 'p', modifiers: [], Key: P
2017-08-13 10:21:30,455 DEBUG - service - Window visible title: b'~/Documents/Text/test.txt \xe2\x80\xa2 - Sublime Text', Window class: 'subl3.Subl3'
2017-08-13 10:21:30,455 DEBUG - service - No phrase/script matched hotkey
2017-08-13 10:21:30,456 DEBUG - service - Input stack at end of handle_keypress: deque(['E', 'X', 'P'], maxlen=150)
2017-08-13 10:21:30,652 DEBUG - service - Raw key: 'l', modifiers: [], Key: A
2017-08-13 10:21:30,652 DEBUG - service - Window visible title: b'~/Documents/Text/test.txt \xe2\x80\xa2 - Sublime Text', Window class: 'subl3.Subl3'
2017-08-13 10:21:30,652 DEBUG - service - No phrase/script matched hotkey
2017-08-13 10:21:30,653 DEBUG - service - Input stack at end of handle_keypress: deque(['E', 'X', 'P', 'A'], maxlen=150)
2017-08-13 10:21:30,782 DEBUG - service - Raw key: 'e', modifiers: [], Key: N
2017-08-13 10:21:30,782 DEBUG - service - Window visible title: b'~/Documents/Text/test.txt \xe2\x80\xa2 - Sublime Text', Window class: 'subl3.Subl3'
2017-08-13 10:21:30,782 DEBUG - service - No phrase/script matched hotkey
2017-08-13 10:21:30,783 DEBUG - service - Input stack at end of handle_keypress: deque(['E', 'X', 'P', 'A', 'N'], maxlen=150)
2017-08-13 10:21:30,985 DEBUG - service - Raw key: 'h', modifiers: [], Key: S
2017-08-13 10:21:30,985 DEBUG - service - Window visible title: b'~/Documents/Text/test.txt \xe2\x80\xa2 - Sublime Text', Window class: 'subl3.Subl3'
2017-08-13 10:21:30,985 DEBUG - service - No phrase/script matched hotkey
2017-08-13 10:21:30,986 DEBUG - service - Input stack at end of handle_keypress: deque(['E', 'X', 'P', 'A', 'N', 'S'], maxlen=150)
2017-08-13 10:21:31,114 DEBUG - service - Raw key: 'a', modifiers: [], Key: I
2017-08-13 10:21:31,115 DEBUG - service - Window visible title: b'~/Documents/Text/test.txt \xe2\x80\xa2 - Sublime Text', Window class: 'subl3.Subl3'
2017-08-13 10:21:31,115 DEBUG - service - No phrase/script matched hotkey
2017-08-13 10:21:31,115 DEBUG - service - Input stack at end of handle_keypress: deque(['E', 'X', 'P', 'A', 'N', 'S', 'I'], maxlen=150)
2017-08-13 10:21:31,214 DEBUG - service - Raw key: 't', modifiers: [], Key: O
2017-08-13 10:21:31,214 DEBUG - service - Window visible title: b'~/Documents/Text/test.txt \xe2\x80\xa2 - Sublime Text', Window class: 'subl3.Subl3'
2017-08-13 10:21:31,214 DEBUG - service - No phrase/script matched hotkey
2017-08-13 10:21:31,214 DEBUG - service - Input stack at end of handle_keypress: deque(['E', 'X', 'P', 'A', 'N', 'S', 'I', 'O'], maxlen=150)
2017-08-13 10:21:31,330 DEBUG - service - Raw key: 'e', modifiers: [], Key: N
2017-08-13 10:21:31,331 DEBUG - service - Window visible title: b'~/Documents/Text/test.txt \xe2\x80\xa2 - Sublime Text', Window class: 'subl3.Subl3'
2017-08-13 10:21:31,331 DEBUG - service - No phrase/script matched hotkey
2017-08-13 10:21:31,331 DEBUG - service - Input stack at end of handle_keypress: deque(['E', 'X', 'P', 'A', 'N', 'S', 'I', 'O', 'N'], maxlen=150)
2017-08-13 10:21:31,520 DEBUG - service - Raw key: 'r', modifiers: [], Key: 1
2017-08-13 10:21:31,520 DEBUG - service - Window visible title: b'~/Documents/Text/test.txt \xe2\x80\xa2 - Sublime Text', Window class: 'subl3.Subl3'
2017-08-13 10:21:31,520 DEBUG - service - No phrase/script matched hotkey
2017-08-13 10:21:31,520 DEBUG - service - Input stack at end of handle_keypress: deque(['E', 'X', 'P', 'A', 'N', 'S', 'I', 'O', 'N', '1'], maxlen=150)
2017-08-13 10:21:31,641 DEBUG - service - Raw key: ' ', modifiers: [], Key:
2017-08-13 10:21:31,642 DEBUG - service - Window visible title: b'~/Documents/Text/test.txt \xe2\x80\xa2 - Sublime Text', Window class: 'subl3.Subl3'
2017-08-13 10:21:31,642 DEBUG - service - No phrase/script matched hotkey
2017-08-13 10:21:31,642 DEBUG - service - Input stack at end of handle_keypress: deque(['E', 'X', 'P', 'A', 'N', 'S', 'I', 'O', 'N', '1', ' '], maxlen=150)
2017-08-13 10:21:31,995 DEBUG - iomediator - <ctrl> pressed
2017-08-13 10:21:32,151 DEBUG - service - Raw key: '<backspace>', modifiers: ['<ctrl>'], Key: <backspace>
2017-08-13 10:21:32,151 DEBUG - service - Window visible title: b'~/Documents/Text/test.txt \xe2\x80\xa2 - Sublime Text', Window class: 'subl3.Subl3'
Notice how all the keys are capitals? The reason why it stops expanding is because it thinks I typed "EXPANSION1" and not "expansion1". I don't have "ignore case" selected.
I was definitely typing in lower case. In fact, I have a CapsLock key disabled so it's impossible for me to type something in all upper case by accident.
And notice how Autokey reports Raw key: 'r', modifiers: [], Key: R
? So no modifiers yet it converts it into upper case. When Autokey works properly, we see this for 'R': Raw key: 'r', modifiers: ['<shift>'], Key: R
.
That's definitely a bug somewhere.
Version
autokey-gtk 0.93.10
Installed via: AUR
Distro: Arch
Workaround
Select ignore case for each abbreviation. But this might introduce some other issues (conflicts) depending on your abbreviations.
EDIT: It happened again and now when I tried typing the abbreviation with a Shift key pressed, it worked. Here's the log: Raw key: 'r', modifiers: ['<shift>'], Key: r
. Some key/mouse event triggers Autokey's modifiers flag and Autokey forgets to clear it and flip it back.
bug autokey-qt autokey-gtk AutoKey triggers