← Back to team overview

sikuli-driver team mailing list archive

[Question #226168]: (Swedish) Typing with swedish letters

 

A question was asked in a language (Swedish) spoken by
none of the registered Sikuli answer contacts.

https://answers.launchpad.net/sikuli/+question/226168

Hello Sikuli,

Thank you for a great product! We use version X-1.0rc3 together with Robot Framework version 2.6.3.

We use it for testing a product in Sweden, and we need to be able to type text with Swedish letters in it (e.g. å, ä, ö). Here’s what we’re doing now:



    from sikuli.Sikuli import *

    def etype(self, text):
        for char in text:
            if char == "\xe5":     # if it's å
                r = Region(0, 0, 1000, 1000)
                r.keyDown(Key.ALT)
                type(Key.NUM1 + Key.NUM3 + Key.NUM4)
                r.keyUp(Key.ALT)
            elif char == "\xf6":   # if it's ö
                r = Region(0, 0, 1000, 1000)
                r.keyDown(Key.ALT)
                type(Key.NUM1 + Key.NUM4 + Key.NUM8)
                r.keyUp(Key.ALT)
            else:
                type(char)

Is there a better way to solve this issue? Preferably by using the letters within strings in the code.

Regards,
-Mehrdad

Mehrdad Shahnavazi
Tester, automation
 


-- 
You received this question notification because you are a member of
Sikuli Drivers, which is an answer contact for Sikuli.