Skip to content

Report live region changes outside of web content (E.g. settings search messages, Windows update progress on logon, and Skype for business chat messages etc)#7287

Merged
michaelDCurran merged 9 commits into
masterfrom
i7286
Aug 2, 2017

Conversation

@michaelDCurran

Copy link
Copy Markdown
Member

Link to issue number:

Fixes #7286

This PR implements support for live regions outside of web content by listening to both UIA liveRegionChanged and MSAA object_liveRegionChanged events, and mapping them to event_liveRegionChange.
A base implementation has been provided on the base NVDAObject, which just reports the name of the object when the event is fired. This is enough for Skype store app, Settings search messages (I.e. "no search results").
An appModule has been also provided for Skype for Business which has a custom implementation of event_liveRegionChange, which works around Skype for Business's strange way of concatinating new messages from the same person in the same minute.
The PR also stubs out event_liveRegionChange on the base MSHTML NVDAObject, as MSHTML live regions are already handled much better via custom in-process code.

…tent. UIA's liveRegionChanged event, and MSAA's object_liveRegionChanged event are mapped to a new liveRegionChange event in NVDA. the base NVDAObject handles this event by simply reporting the name of the object in speech and braille.
…has custom live region support via virtualBuffers that is much more accurate.
Comment thread source/appModules/lync.py
content=self.value.replace('\r','\n').strip()
fullText=self.name.replace('\r\n\r\n','\n')
contentLines=content.split('\n')
contentStartIndex=fullText.find(content)

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

So if I'm understanding this right, self.name contains self.value ?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think it might be handy to have some examples of what these fields might look like before the processing is done. Or perhaps unit tests?

Comment thread source/appModules/lync.py Outdated
pretext=fullText[:contentStartIndex]
# There are some annoying comma characters after the person's name
pretext=pretext.replace(' ,','')
# If the object's are the same, the person is the asame, and the new content is the old content but with more appended, report the appended content

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

typo: asame should be same

Comment thread source/appModules/lync.py

class AppModule(appModuleHandler.AppModule):

_lastLiveChatMessageData=[],"",[]

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Probably worth having a docstring to describe what each of these entries are.

Comment thread source/appModules/lync.py Outdated
# Example string: "Michael Curran : , , Hello\nThis is a test , 10:45 am."
# Where person is "Michael Curran", content is "Hello\nThis is a test" and timestamp is "10:45 am"
# The object's value just contains the content.
# Example: "Hello\nThis is a test"

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Maybe include in these examples the \r\n details. To show what the raw strings we get are like.

@josephsl

Copy link
Copy Markdown
Contributor

Hi,

An important issue found: in some apps such as Maps app in Windows 10, the app keeps firing live region change event even when the content hasn't changed. At the moment my workaround is to store the last spoken message as part of the app module and announce new content if the conditions are right (current message isn't the same as the last one known).

Thanks.

@michaelDCurran

michaelDCurran commented Jun 25, 2017 via email

Copy link
Copy Markdown
Member Author

@josephsl

josephsl commented Jun 25, 2017 via email

Copy link
Copy Markdown
Contributor

@michaelDCurran

michaelDCurran commented Jun 25, 2017 via email

Copy link
Copy Markdown
Member Author

@josephsl

josephsl commented Jun 25, 2017 via email

Copy link
Copy Markdown
Contributor

@michaelDCurran

michaelDCurran commented Jun 25, 2017 via email

Copy link
Copy Markdown
Member Author

@michaelDCurran

michaelDCurran commented Jun 26, 2017 via email

Copy link
Copy Markdown
Member Author

@josephsl

Copy link
Copy Markdown
Contributor

Hi,

Try it with Windows 10 App Essentials add-on disabled:

Maps:

  1. Run Maps and allow Maps to access your current location.
  2. If a prompt appears asking if Maps can access your location, say "yes" or answer affirmative.3. From main screen of Maps app, select My Location button.

Expected: no repeats as to the current map view.
Actual: map view is repeated.

Windows Store:

  1. Open Store, go to User Profile, press SPCE to open the pop-up and select Downloads.
  2. Check for app updates.
  3. If updates are set to download automatically or if no prompts are seen when updates are available, you'll hear progress messages.

Expected: no repeated announcements.
Actual: announcements are repeated.

Thanks.

@michaelDCurran

Copy link
Copy Markdown
Member Author

@josephsl: Do you know if the duplicate live region change events happen in Creaters update 15063? I am now finally seeing them in 16232, but was not seeing them in 16215, so am wondering if they were a recent bug. If so, then we have more time to report it to Microsoft. Mind you, I'm also seeing crashes in maps now which is making this hard to debug.

@josephsl

josephsl commented Jul 11, 2017 via email

Copy link
Copy Markdown
Contributor

…text within a short time of each other. Multiple apps in windows 10 (Maps, Store etc) have buggy events. No runtimeID check can be made here as in many cases multiple elements in a list (E.g. store updates for each app) are firing all at the same time.

* Added a _shouldAllowUIALiveRegionChangeEvent property to UIA NVDAObject. This is private as it may be changed or removed in the future when live region events are rethought in Windows 10. this property  compairs the text and time against the last liveRegion change.
@michaelDCurran

Copy link
Copy Markdown
Member Author

@jcsteh could you please have a quick look at this: the specific commit is 515c285. This is really meant to be only temporary.

@michaelDCurran michaelDCurran requested a review from jcsteh July 18, 2017 05:12

@jcsteh jcsteh left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

No runtimeID check can be made here as in many cases multiple elements in a list (E.g. store updates for each app) are firing all at the same time.

Do you mean multiple list items all have a live region containing the same text?

newText=self.name
newTime=time.time()
if newText==oldText and oldTime is not None and (newTime-oldTime)<0.5:
return False

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do we still want to update the cached time if the text is equal? Unless I'm missing something, this will still spam every half second if the same text keeps firing.

return True

_lastLiveRegionChangeInfo=(None,None) #: Keeps track of the last live region change (text, time)
def _get__shouldAllowUIALiveRegionChangeEvent(self):

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It'd be good to have a brief comment here explaining what this does, similar to your commit summary. Not that the code is complex, but super clarity is nice. :)

@josephsl

josephsl commented Jul 19, 2017 via email

Copy link
Copy Markdown
Contributor

michaelDCurran added a commit that referenced this pull request Jul 19, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants