diff --git a/source/NVDAObjects/IAccessible/__init__.py b/source/NVDAObjects/IAccessible/__init__.py index ebe78723975..295a982d15b 100644 --- a/source/NVDAObjects/IAccessible/__init__.py +++ b/source/NVDAObjects/IAccessible/__init__.py @@ -1471,10 +1471,10 @@ def event_alert(self): api.processPendingEvents() if self in api.getFocusAncestors(): return - speech.speakObject(self, reason=controlTypes.REASON_FOCUS, priority=speech.Spri.NOW) + speech.speakObject(self, reason=controlTypes.OutputReason.FOCUS, priority=speech.Spri.NOW) for child in self.recursiveDescendants: if controlTypes.STATE_FOCUSABLE in child.states: - speech.speakObject(child, reason=controlTypes.REASON_FOCUS, priority=speech.Spri.NOW) + speech.speakObject(child, reason=controlTypes.OutputReason.FOCUS, priority=speech.Spri.NOW) def event_caret(self): focus = api.getFocusObject() @@ -1956,11 +1956,11 @@ class IENotificationBar(Dialog,IAccessible): def event_alert(self): speech.cancelSpeech() - speech.speakObject(self,reason=controlTypes.REASON_FOCUS) + speech.speakObject(self, reason=controlTypes.OutputReason.FOCUS) child=self.simpleFirstChild while child: if child.role!=controlTypes.ROLE_STATICTEXT: - speech.speakObject(child,reason=controlTypes.REASON_FOCUS) + speech.speakObject(child, reason=controlTypes.OutputReason.FOCUS) child=child.simpleNext diff --git a/source/NVDAObjects/IAccessible/ia2Web.py b/source/NVDAObjects/IAccessible/ia2Web.py index 2f69390c967..d475130c6d0 100644 --- a/source/NVDAObjects/IAccessible/ia2Web.py +++ b/source/NVDAObjects/IAccessible/ia2Web.py @@ -87,7 +87,10 @@ def event_IA2AttributeChange(self): if self is api.getFocusObject(): # Report aria-current if it changed. speech.speakObjectProperties( - self, current=True, reason=controlTypes.REASON_CHANGE) + self, + current=True, + reason=controlTypes.OutputReason.CHANGE + ) # super calls event_stateChange which updates braille, so no need to # update braille here. diff --git a/source/NVDAObjects/IAccessible/winword.py b/source/NVDAObjects/IAccessible/winword.py index 57bcce07eb1..acc273a6377 100644 --- a/source/NVDAObjects/IAccessible/winword.py +++ b/source/NVDAObjects/IAccessible/winword.py @@ -269,7 +269,7 @@ def script_caret_moveByCell(self,gesture): isCollapsed=info.isCollapsed if inTable: info.expand(textInfos.UNIT_CELL) - speech.speakTextInfo(info,reason=controlTypes.REASON_FOCUS) + speech.speakTextInfo(info, reason=controlTypes.OutputReason.FOCUS) braille.handler.handleCaretMove(self) def script_reportCurrentComment(self,gesture): @@ -339,7 +339,7 @@ def _moveInTable(self,row=True,forward=True): ui.message(_("Edge of table")) return False newInfo=WordDocumentTextInfo(self,textInfos.POSITION_CARET,_rangeObj=foundCell) - speech.speakTextInfo(newInfo,reason=controlTypes.REASON_CARET, unit=textInfos.UNIT_CELL) + speech.speakTextInfo(newInfo, reason=controlTypes.OutputReason.CARET, unit=textInfos.UNIT_CELL) newInfo.collapse() newInfo.updateCaret() return True diff --git a/source/NVDAObjects/UIA/__init__.py b/source/NVDAObjects/UIA/__init__.py index 37cd11a9599..639d65e80f8 100644 --- a/source/NVDAObjects/UIA/__init__.py +++ b/source/NVDAObjects/UIA/__init__.py @@ -1668,7 +1668,7 @@ def event_UIA_systemAlert(self): This just reports the element that received the alert in speech and braille, similar to how focus is presented. Skype for business toast notifications being one example. """ - speech.speakObject(self, reason=controlTypes.REASON_FOCUS) + speech.speakObject(self, reason=controlTypes.OutputReason.FOCUS) # Ideally, we wouldn't use getPropertiesBraille directly. braille.handler.message(braille.getPropertiesBraille(name=self.name, role=self.role)) @@ -1768,7 +1768,7 @@ def event_focusEntered(self): def event_valueChange(self): focusParent=api.getFocusObject().parent if self==focusParent: - speech.speakObjectProperties(self,value=True,reason=controlTypes.REASON_CHANGE) + speech.speakObjectProperties(self, value=True, reason=controlTypes.OutputReason.CHANGE) else: super(SensitiveSlider,self).event_valueChange() diff --git a/source/NVDAObjects/UIA/edge.py b/source/NVDAObjects/UIA/edge.py index cbd84185868..beb661d9808 100644 --- a/source/NVDAObjects/UIA/edge.py +++ b/source/NVDAObjects/UIA/edge.py @@ -588,7 +588,11 @@ def _iterNodesByType(self,nodeType,direction="next",pos=None): def shouldPassThrough(self,obj,reason=None): # Enter focus mode for selectable list items (