← Back to team overview

sikuli-driver team mailing list archive

Re: [Question #234855]: TypeError ( type(): 1st arg can't be coerced to String )

 

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

    Status: Open => Answered

Roman Podolyan proposed the following answer:
http://doc.sikuli.org/region.html#Region.type
type([PSMRL], text[, modifiers])

You're missing the "text" part. First argument of "type" should be
something like text or Key.CONSTANT.

This returns error:
type ('F',KeyModifier.WIN)

This works:
type ('f',KeyModifier.WIN)
wait(1)


But if you need only to call system menu, you may want to do something else.

Here is the piece of code:

    #this works and calls Windows system menu
    keyDown(Key.WIN)
    keyUp(Key.WIN)
    wait(2)
    popup('it was first way')
    wait(2)
    #this works and calls Windows system menu
    type (Key.WIN)
    wait(2)
    popup('it was second way')
    wait(2)
    #this calls Windows system menu too
    type(Key.ESC, KeyModifier.CTRL)
    wait(2)
    popup('it was third way')

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