Re: Start to scripting Orca



Hi  Javier,

I am going to help with planner and learn some scripting quote a piece of
code:

filler = event.source.parent
            allLabels = atspi.findByRole(filler, rolenames.ROLE_LABEL)
            speech.speak(allLabels[0].name)
            default.onFocus(event, event.source) #We need to do default
after label spoken too is this correct?
Then else also do the default. return

Or more simply, just remove the return and drop through and do the default
action for a focus event for this component (the toggle button). This is the
approach that Mike (Pedersen) has been suggesting for other similar problems.
In other words, the extra information is just spoken but not brailled.

I'll check that change into CVS HEAD later this morning. Thanks.

Then before or after speak label, would be good to braille it. I don't know
exactly how to manage the brailleGenerator.
I think firstly we need to get the regions for the current object?
CurrentRegion = brailleGen.getBrailleRegions(event.source) and then add the
label to the currentRegion?
I'll leave it to Mike to say whether we should braille this extra information as well as
just speak it. If we were going to do that, it would be something like:

           filler = event.source.parent
           allLabels = atspi.findByRole(filler, rolenames.ROLE_LABEL)
           utterance = allLabels[0].name
           speech.speak(utterance)
           brailleRegions = brailleGen.getBrailleRegions(event.source)
           brailleRegions.append(braille.Region(utterance))
           braille.displayRegions(brailleRegions)
           return

I haven't tested this, so it might need tweaking.

Mike, which would you prefer for our default planner.py script?

Javier, note that you can always have your own personal copy
of this script in your ~/.orca/orca_scripts/ directory. If you put it
in there, don't forget to create an empty __init__.py file in the same
directory so that it'll correctly get picked up.






[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]