Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report alerts conveied by UI Automation's systemAlert event #7282

Merged
merged 2 commits into from Jul 4, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
10 changes: 10 additions & 0 deletions source/NVDAObjects/UIA/__init__.py
Expand Up @@ -1289,6 +1289,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 @@ -131,6 +131,7 @@
#UIA_AsyncContentLoadedEventId:"documentLoadComplete",
#UIA_ToolTipClosedEventId:"hide",
UIA_Window_WindowOpenedEventId:"UIA_window_windowOpen",
UIA_SystemAlertEventId:"UIA_systemAlert",
}

class UIAHandler(COMObject):
Expand Down