def addressField(self, index, rightClick): if self.isDocument(): fields = [] for item in filter(lambda o: o.role == controlTypes.ROLE_UNKNOWN, self.getPropertyPage().children): try: fields.append(item.children[0].children[0]) except IndexError: pass if index >= len(fields): return try: ui.message(",".join( [o.name for o in fields[index].parent.children])) except (IndexError, AttributeError): #TRANSLATORS: cannot find sender address ui.message(_("Not found")) if rightClick: api.moveMouseToNVDAObject( fields[index].getChild(0).getChild(1)) api.setMouseObject(fields[index].getChild(0).getChild(1)) winUser.mouse_event(winUser.MOUSEEVENTF_RIGHTDOWN, 0, 0, None, None) winUser.mouse_event(winUser.MOUSEEVENTF_RIGHTUP, 0, 0, None, None) speech.pauseSpeech(True) else: #TRANSLATORS: message spoken if you try to read the sender address out of a message window ui.message(_("you are not in a message window"))
def script_skipPreviousOutside(self, gesture): obj = self.previousOutsideObject while obj: if obj.isFocusable: api.setFocusObject(obj) if controlTypes.STATE_FOCUSED in obj.states: return obj = obj.previous if self.container.simpleParent.role == controlTypes.ROLE_DIALOG: api.setNavigatorObject(self.focusableContainer) scriptHandler.executeScript( globalCommands.commands.script_review_activate, None) pauseSpeech(True) return gesture.send()
def script_skipNextOutside(self, gesture): obj = self.nextOutsideObject while obj: if obj.isFocusable: api.setFocusObject(obj) if controlTypes.STATE_FOCUSED in obj.states: return # The object has received the focus correctly obj = obj.next # Has not been able to get out of the table if self.container.simpleParent.role == controlTypes.ROLE_DIALOG: # If we are in a dialogue, focus on the top panel api.setNavigatorObject(self.focusableContainer) scriptHandler.executeScript( globalCommands.commands.script_review_activate, None) pauseSpeech(True) return gesture.send()
def script_menu(self, gesture): obj = api.getNavigatorObject() if obj.parent == self and controlTypes.STATE_INVISIBLE not in obj.states: scriptHandler.executeScript( globalCommands.commands.script_moveMouseToNavigatorObject, None) pauseSpeech(True) x, y = winUser.getCursorPos() if x >= obj.location[0]: winUser.mouse_event(winUser.MOUSEEVENTF_RIGHTDOWN, 0, 0, None, None) winUser.mouse_event(winUser.MOUSEEVENTF_RIGHTUP, 0, 0, None, None) else: # TRANSLATORS: Message when it can't click in a item of the toolbar ui.message( _("Can't click in %s, try to maximize the window") % (obj.name if obj.name else controlTypes.roleLabels[obj.role])) else: beep(200, 80)
category = scriptInfo[0].category except AttributeError: category = getattr(scriptInfo[1], "scriptCategory", miscName) if not categories.get(category): categories[cat] = HelpCategory(cat) categories[cat].addRow(command["text"], doc) for category in categories.values(): html+=category.html() ui.browseableMessage(html, #Translators: The title of the context sensitive help for Dictation Bridge NVDA Commands. _("Dictation Bridge NVDA Context Sensitive Help"), True) SPECIAL_COMMANDS = { "stopTalking" : speech.cancelSpeech, "toggleTalking" : lambda:speech.pauseSpeech(not speech.isPaused), "dbHelp" : dbHelp, } def successDialog(program): #Translators: Message shown if the commands were installed into dragon successfully. gui.messageBox(_("The {0} commands were successfully installed. Please restart your {0} profile to proceed. See the manual for details on how to do this.").format(program), #Translators: Title of the successfully installed commands dialog _("Success!")) def _onInstallDragonCommands(): si = subprocess.STARTUPINFO() si.dwFlags |= subprocess.STARTF_USESHOWWINDOW si.wShowWindow = subprocess.SW_HIDE dragonDir = r"C:\Program Files (x86)\Nuance\NaturallySpeaking15\Program" #Translators: Title of an error dialog shown in dictation bridge.
category = getattr(scriptInfo[1], "scriptCategory", miscName) if not categories.get(category): categories[cat] = HelpCategory(cat) categories[cat].addRow(command["text"], doc) for category in categories.values(): html += category.html() ui.browseableMessage( html, #Translators: The title of the context sensitive help for Dictation Bridge NVDA Commands. _("Dictation Bridge NVDA Context Sensitive Help"), True) SPECIAL_COMMANDS = { "stopTalking": speech.cancelSpeech, "toggleTalking": lambda: speech.pauseSpeech(not speech.isPaused), "dbHelp": dbHelp, } def successDialog(program): #Translators: Message shown if the commands were installed into dragon successfully. gui.messageBox( _("The {0} commands were successfully installed. Please restart your {0} profile to proceed. See the manual for details on how to do this." ).format(program), #Translators: Title of the successfully installed commands dialog _("Success!")) def _onInstallDragonCommands(): si = subprocess.STARTUPINFO()
def resume(self, args): "Resume speech." speech.pauseSpeech(False)
def pause(self, args): "Pause speech." speech.pauseSpeech(True)