Skip to content

Commit

Permalink
Report alerts conveied by UI Automation's systemAlert event (#7282)
Browse files Browse the repository at this point in the history
* Support UI Automation's systemAlert event, and provide a basic implementation that just reports the element that received the event in speech and braille, similar to focus.
Examples of where this alert is fired are Skype for Business notifications and Microsoft Edge notifications.

* Also support UIA systemAlert in braille.
  • Loading branch information
michaelDCurran committed Jul 4, 2017
1 parent a863704 commit ce06911
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 0 deletions.
10 changes: 10 additions & 0 deletions source/NVDAObjects/UIA/__init__.py
Expand Up @@ -1308,6 +1308,16 @@ def event_valueChange(self):
return
return super(UIA, self).event_valueChange()

def event_UIA_systemAlert(self):
"""
A base implementation for UI Automation's system Alert event.
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)
# Ideally, we wouldn't use getBrailleTextForProperties directly.
braille.handler.message(braille.getBrailleTextForProperties(name=self.name, role=self.role))

class TreeviewItem(UIA):

def _get_value(self):
Expand Down
1 change: 1 addition & 0 deletions source/_UIAHandler.py
Expand Up @@ -138,6 +138,7 @@
#UIA_AsyncContentLoadedEventId:"documentLoadComplete",
#UIA_ToolTipClosedEventId:"hide",
UIA_Window_WindowOpenedEventId:"UIA_window_windowOpen",
UIA_SystemAlertEventId:"UIA_systemAlert",
}

class UIAHandler(COMObject):
Expand Down

0 comments on commit ce06911

Please sign in to comment.