← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #255660]: Cannot make Sikuli X type in Turkish language

 

Question #255660 on Sikuli changed:
https://answers.launchpad.net/sikuli/+question/255660

    Status: Open => Answered

RaiMan proposed the following answer:
sorry, just was busy on Windows, to fix problems with 1.1.0 ;-)

# put it outside the def
harfler = {"ü": "0252","Ü": "0220","ı": "0305","İ": "0304","ç": "0231","Ç": "0199","ö": "0246","Ö": "0214","ğ": "0287","Ğ": "0208","ş": "0351","Ş": "0350"}

def yaz(metin):
    global harfler
    for cMetin in metin:
        yazilacak = harfler.get(cMetin) #returns None, if not a character in harfler
        if not yazilacak: 
            type(cMetin)
        else:
            keyDown(Key.ALT)
            type(Key.NUM+yazilacak[0])
            type(Key.NUM+yazilacak[1])
            type(Key.NUM+yazilacak[2])
            type(Key.NUM+yazilacak[3])
        keyUp()

Strings are taken as a list of characters if used as one would use a
list ("1234"[3] yields "4")

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