Serious bug (at least for Swedish, German and some more users)

98 views
Skip to first unread message

Johnny Rosenberg

unread,
Apr 11, 2010, 3:37:54 AM4/11/10
to autoke...@googlegroups.com
It seems like Swedish (and other countries') characters like åäöÅÄÖ
work like trigger characters now. I don't know if that was the case in
previous versions.

For example if I type a word like ”plötsligt”, ”pl” will be expanded.
Those characters are very common when you type in Swedish so that need
to be changed as soon as possible, I guess.

I guess I will now spend an hour or two changing all my phrases to
only expand by Enter or Space.

Regards

Johnny Rosenberg.

Chris Dekter

unread,
Apr 11, 2010, 3:41:34 AM4/11/10
to autoke...@googlegroups.com
That is unexpected - I made no changes to the trigger character
definitions etc.

If you run autokey in debug mode from the terminal (with the -l
switch), does the ö get detected correctly as such? (You should see a
log message each time you type a character)

> --
> To unsubscribe, reply using "remove me" as the subject.
>

Johnny Rosenberg

unread,
Apr 11, 2010, 3:49:04 AM4/11/10
to autoke...@googlegroups.com
2010/4/11 Chris Dekter <cde...@gmail.com>:

> That is unexpected - I made no changes to the trigger character
> definitions etc.
>
> If you run autokey in debug mode from the terminal (with the -l
> switch), does the ö get detected correctly as such? (You should see a
> log message each time you type a character)

DEBUG - service - Key: ö
DEBUG - service - Input stack at end of handle_keypress: [u'\xf6']


Regards

Johnny Rosenberg

Chris Dekter

unread,
Apr 11, 2010, 4:00:09 AM4/11/10
to autoke...@googlegroups.com
That all looks fine. At this stage I don't have any clues as to why
this has changed. Have you changed any locale or keymap settings on
your PC lately? The set of characters that are considered 'word
characters' is defined by the standard Python regex framework so
AutoKey has no direct control over it.

Mean time, if you want a quick way to change all your abbreviations to
use Space & Enter Only, you can do a search and replace in the
autokey.json file to replace all instances of "[\\w]" with "[^ \\n]"
(without the quotes obviously).

Helgi Örn

unread,
Apr 11, 2010, 4:48:33 AM4/11/10
to autoke...@googlegroups.com
Swedish letters works fine for me, but not the Icelandic ones, those
have never worked since I started using Autokey. Now this has changed
a bit, before this latest version Autokey spat out some garble symbols
instead of the Icelandic letters, now theres nothing at all:

This:
Kr kveja

Is supposed to be this:
Kær kveðja

Johnny Rosenberg

unread,
Apr 11, 2010, 5:25:00 AM4/11/10
to autoke...@googlegroups.com
2010/4/11 Chris Dekter <cde...@gmail.com>:

> That all looks fine. At this stage I don't have any clues as to why
> this has changed. Have you changed any locale or keymap settings on
> your PC lately?

No and I just tried the same thing on my Eee PC, also running Ubuntu
9.10 and it happens there too. Also characters like #@%&/()=+¨^~ etc
seems to trig Autokey, so you don't need a keyboard with åäö to try
this yourself. Characters like ‰ doesn't however trig Autokey.

Ubuntu 9.10 with Swedish language packages installed
AutoKey (GTK) 0.70.0


I was just thinking, why don't you include some older version of
AutoKey in your repository? It would then be easy for users who
installed a new version that doesn't work properly for them to install
the old version again while waiting for a fix. Just a thought.


Regards

Johnny Rosenberg


> The set of characters that are considered 'word
> characters' is defined by the standard Python regex framework so
> AutoKey has no direct control over it.
>
> Mean time, if you want a quick way to change all your abbreviations to
> use Space & Enter Only, you can do a search and replace in the
> autokey.json file to replace all instances of "[\\w]" with "[^ \\n]"
> (without the quotes obviously).

Well, I found that I still need to use characters like .,:() and so
on, as trigger characters, so I guess I won't change after all, but
thanks anyway.

Johnny Rosenberg

unread,
Apr 11, 2010, 5:37:10 AM4/11/10
to autoke...@googlegroups.com
2010/4/11 Helgi Örn <sacre...@gmail.com>:

> Swedish letters works fine for me, but not the Icelandic ones, those
> have never worked since I started using Autokey.

Swedish characters work for me too, but not they have started acting
like trigger characters, so if I have a phrase like ”Pipeline”
triggered by the abbreviation ”pl” and then type a word like
”plötsligt” (=”suddenly”), it all ends up with ”Pipelinetsligt”.
That's not very convenient…

> Now this has changed
> a bit, before this latest version Autokey spat out some garble symbols
> instead of the Icelandic letters, now theres nothing at all:
>
> This:
> Kr kveja
>
> Is supposed to be this:
> Kær kveðja

I tried that and it locks my keyboard…! Had to cancel Autokey to get
my keyboard working again. Tried it twice, same result both times.

Seems that there are some bugs to solve here, unfortunately.

Chris Dekter

unread,
Apr 11, 2010, 5:39:25 AM4/11/10
to autoke...@googlegroups.com
Well... let's try and debug this.

How are those missing characters typed on your keyboard?

2010/4/11 Helgi Örn <sacre...@gmail.com>:

Johnny Rosenberg

unread,
Apr 11, 2010, 5:58:17 AM4/11/10
to autoke...@googlegroups.com
2010/4/11 Chris Dekter <cde...@gmail.com>:

> Well... let's try and debug this.
>
> How are those missing characters typed on your keyboard?

I guess you are referring to Helgi Örn, but when I tried the phrase I
only got a ”K” and then the keyboard froze.
I suppose that Helgi is from Iceland and in that case I guess that he
use an Icelandic keyboard with those Icelandic characters included
from start.
Actually those characters are also included in the Swedish standard
keyboard layout for Ubuntu, but I need to use the AltGr key to type
them. I guess Helgi doesn't need to do that.

You can have a look at the Icelandic layout at [System → Preferences →
Keyboard → Layouts → Add…] or something like that.


Regards

Johnny Rosenberg

Chris Dekter

unread,
Apr 11, 2010, 6:06:59 AM4/11/10
to autoke...@googlegroups.com
On 11 April 2010 19:37, Johnny Rosenberg <gurus....@gmail.com> wrote:
> Swedish characters work for me too, but not they have started acting
> like trigger characters, so if I have a phrase like ”Pipeline”
> triggered by the abbreviation ”pl” and then type a word like
> ”plötsligt” (=”suddenly”), it all ends up with ”Pipelinetsligt”.
> That's not very convenient…

OK... it seems this bug was introduced by the new config file code.
The fix will be in the next version, but if you like you can easily
fix it like so:

Edit /usr/share/pyshared/autokey/model.py

Change line 56 from:

self.wordChars = re.compile(data["wordChars"])

to:

self.wordChars = re.compile(data["wordChars"], re.UNICODE)


> I tried that and it locks my keyboard…! Had to cancel Autokey to get
> my keyboard working again. Tried it twice, same result both times.

This suggests an exception is occurring while sending one of the key
events - it would be good to see the log output during from this
occurrence.

> Seems that there are some bugs to solve here, unfortunately.

It's one of the perils of using software from a PPA - it's not
guaranteed to be stable.

Helgi Örn

unread,
Apr 11, 2010, 7:14:51 AM4/11/10
to autoke...@googlegroups.com
On 11 April 2010 11:39, Chris Dekter <cde...@gmail.com> wrote:
> Well... let's try and debug this.
>
> How are those missing characters typed on your keyboard?
>

http://commons.wikimedia.org/wiki/File:KB_Iceland.svg

I am using a swedish Mac keyboard (wired, thin aluminium) and I use
both swedish and icelandic layout, frequently switch between them.
Ubuntu 9.10.

Helgi Örn

unread,
Apr 11, 2010, 7:18:46 AM4/11/10
to autoke...@googlegroups.com
On 11 April 2010 11:58, Johnny Rosenberg <gurus....@gmail.com> wrote:
> 2010/4/11 Chris Dekter <cde...@gmail.com>:
>> Well... let's try and debug this.
>>
>> How are those missing characters typed on your keyboard?
>
> I guess you are referring to Helgi Örn, but when I tried the phrase I
> only got a ”K” and then the keyboard froze.
> I suppose that Helgi is from Iceland and in that case I guess that he
> use an Icelandic keyboard with those Icelandic characters included
> from start.
> Actually those characters are also included in the Swedish standard
> keyboard layout for Ubuntu, but I need to use the AltGr key to type
> them. I guess Helgi doesn't need to do that.
>
> You can have a look at the Icelandic layout at [System → Preferences →
> Keyboard → Layouts → Add…] or something like that.
>
I am using a swedish Mac keyboard. Since I live in Sweden I use the
swedish layout as my default but switch frequently over to the
icelandic layout. I sometimes use the AltGr method too.

Chris Dekter

unread,
Apr 11, 2010, 7:19:28 AM4/11/10
to autoke...@googlegroups.com
OK... I've tested this myself and I can get it working perfectly, but
you must set a SINGLE keyboard layout in your layout manager. You
can't use a panel applet or hotkey to switch layouts. Maybe one day
I'll figure out a generic way to detect these layout changes as they
don't generate a XMappingUpdate event. The following is from the
Troubleshooting wiki page:

=== AutoKey mixes up some characters when it sends my phrases. I am
using a non-US keyboard layout with a hotkey or panel applet to switch
between layouts. ===

AutoKey only recognises layout switches that take place within the X
Server. The hotkey/panel applet layout switchers do a 'soft' switch
which does not actually change the underlying X keymap. Aside from
this, the methods for switching are so varied and inconsistent, it
would be impossible to cater for them all. If you wish to use multiple
keyboard layouts, you will need to switch between them using
setxkbmap. You could set up a hotkey within AutoKey to run setxkbmap
and perform the switching. Note that using setxkbmap to set the layout
will disable all other methods (hotkey/panel applet).

2010/4/11 Helgi Örn <sacre...@gmail.com>:

Johnny Rosenberg

unread,
Apr 12, 2010, 1:11:29 PM4/12/10
to autoke...@googlegroups.com
2010/4/11 Chris Dekter <cde...@gmail.com>:

> On 11 April 2010 19:37, Johnny Rosenberg <gurus....@gmail.com> wrote:
>> Swedish characters work for me too, but not they have started acting
>> like trigger characters, so if I have a phrase like ”Pipeline”
>> triggered by the abbreviation ”pl” and then type a word like
>> ”plötsligt” (=”suddenly”), it all ends up with ”Pipelinetsligt”.
>> That's not very convenient…
>
> OK... it seems this bug was introduced by the new config file code.
> The fix will be in the next version, but if you like you can easily
> fix it like so:
>
> Edit /usr/share/pyshared/autokey/model.py
>
> Change line 56 from:
>
> self.wordChars = re.compile(data["wordChars"])
>
> to:
>
> self.wordChars = re.compile(data["wordChars"], re.UNICODE)


Thanks. Works perfectly!

>
>
>> I tried that and it locks my keyboard…! Had to cancel Autokey to get
>> my keyboard working again. Tried it twice, same result both times.
>
> This suggests an exception is occurring while sending one of the key
> events - it would be good to see the log output during from this
> occurrence.

DEBUG - service - Input stack at end of handle_keypress: []
DEBUG - service - Key: a
DEBUG - service - Input stack at end of handle_keypress: [u'a']
DEBUG - service - Key: a
DEBUG - service - Input stack at end of handle_keypress: [u'a', u'a']
DEBUG - service - Key: a
DEBUG - service - Input stack at end of handle_keypress: [u'a', u'a', u'a']
DEBUG - service - Key: <enter>
DEBUG - interface - Send special key: ['<backspace>']
DEBUG - interface - Send special key: ['<backspace>']
DEBUG - interface - Send special key: ['<backspace>']
DEBUG - interface - Send special key: ['<backspace>']
DEBUG - iomediator - Send via event interface
DEBUG - interface - Sending string: u'K\xe6r kve\xf0ja'
Exception in thread KeypressHandler-thread:
Traceback (most recent call last):
File "/usr/lib/python2.6/threading.py", line 525, in __bootstrap_inner
self.run()
File "/usr/lib/python2.6/dist-packages/autokey/iomediator.py", line
189, in run
target.handle_keypress(key, windowName)
File "/usr/lib/python2.6/dist-packages/autokey/service.py", line
156, in handle_keypress
self.__processItem(item, currentInput)
File "/usr/lib/python2.6/dist-packages/autokey/service.py", line
266, in __processItem
self.phraseRunner.execute(item, buffer)
File "/usr/lib/python2.6/dist-packages/autokey/service.py", line
313, in execute
mediator.send_string(expansion.string)
File "/usr/lib/python2.6/dist-packages/autokey/iomediator.py", line
236, in send_string
self.interface.send_string(section)
File "/usr/lib/python2.6/dist-packages/autokey/interface.py", line
411, in send_string
self.__sendKeyCode(keyCode, self.modMasks[Key.ALT_GR])
KeyError: '<alt_gr>'

>
>> Seems that there are some bugs to solve here, unfortunately.
>
> It's one of the perils of using software from a PPA - it's not
> guaranteed to be stable.
>
>

Chris Dekter

unread,
Apr 12, 2010, 9:08:02 PM4/12/10
to autoke...@googlegroups.com
This will be fixed in the next release - it's the same issue Derek was
having with Super.
Reply all
Reply to author
Forward
0 new messages