Re: [orca-list] automatic shortcut spoken question



Dear List and Developers!
I tryed analyze the speechgenerator.py file with following function
(this is an example):
    def _getSpeechForCheckBox(self, obj, already_focused):
        """Get the speech for a check box.  If the check box already had
        focus, then only the state is spoken.

        Arguments:
        - obj: the check box
        - already_focused: False if object just received focus

        Returns a list of utterances to be spoken for the object.
        """

        utterances = []
        state = obj.getState()
        if state.contains(pyatspi.STATE_INDETERMINATE):
            # Translators: this represents the state of a checkbox.
            #
            checkedState = _("partially checked")
        elif state.contains(pyatspi.STATE_CHECKED):
            # Translators: this represents the state of a checkbox.
            #
            checkedState = _("checked")
        else:
            # Translators: this represents the state of a checkbox.
            #
            checkedState = _("not checked")

        # If it's not already focused, say it's name
        #
        if not already_focused:
            label = self._getSpeechForObjectLabel(obj)
            utterances.extend(label)
            name = self._getSpeechForObjectName(obj)
            if name != label:
                utterances.extend(name)
            if obj.getRole() == pyatspi.ROLE_TABLE_CELL:
                utterances.extend(
                  self._getSpeechForObjectRole(
                    obj, pyatspi.ROLE_CHECK_BOX))
            else:
                utterances.extend(self._getSpeechForObjectRole(obj))
            utterances.append(checkedState)
            utterances.extend(self._getSpeechForObjectAvailability(obj))
        else:
            utterances.append(checkedState)

        self._debugGenerator("_getSpeechForCheckBox",
                             obj,
                             already_focused,
                             utterances)

        return utterances

I understand this code, but how can I doing Orca spoken automaticaly the
underlined letter for check boxes, menus, etc?
In where_am_I.py script this function is different:
        utterances = []
        text = self.getObjLabelAndName(obj) + " " + \
               rolenames.getSpeechForRoleName(obj)
        text = text + " " + self._getCheckBoxState(obj)
        utterances.append(text)

        accelerator = self._getObjAccelerator(obj)
        utterances.append(accelerator)

        debug.println(self._debugLevel, "check box utterances=%s" \
                      % utterances)
        speech.speakUtterances(utterances)

I tryed insert this two lines with speechgenerator.py, the quoted function:
        accelerator = self._getObjAccelerator(obj)
        utterances.append(accelerator)

But not happen nothing, the underlined letter not spoken. Why? I tryed
testing with Orca configuration GUI, where am I command spoken this
information correct.

Can anybody help me little instruction? I would like doing this function if
not difficult. :-):-)
Now it is enough if the verbosity setting is brief, Orca spoken this
underlined letters example with check boxes (mnemonic, accelerator
information), if not brief, only default information spoken (now method).

Attila




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