Skip to content

Commit

Permalink
NVDAObjects.UIA.SuggestionListItem: braille suggestion results as fla…
Browse files Browse the repository at this point in the history
…sh messages. re nvaccess#6241.

Suggestion from Davy Kager: provide a way to let braille users read search suggestion items. This is done by emulating some parts of speech.SpeakObjectProperties except the name and position info map will be fetched (position info map fetching is contingent on whether report position info setting is enabled from Object Presentation dialog). Ideally, NVDA objects should have a way to fetch braille flash messages for controls.
Also reworded docstring for SuggestionListItem so it cna include other UIA-based suggestion list items such as Windows 8.x search results.
  • Loading branch information
josephsl committed May 31, 2017
1 parent 733c12c commit e3a8cfc
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion source/NVDAObjects/UIA/__init__.py
Expand Up @@ -1465,7 +1465,7 @@ def event_UIA_controllerFor(self):


class SuggestionListItem(UIA):
"""Windows 10 uses suggestions lists for various things, including Start menu suggestions, Store, Settings app and so on.
"""Recent Windows releases use suggestions lists for various things, including Start menu suggestions, Store, Settings app and so on.
"""

role=controlTypes.ROLE_LISTITEM
Expand All @@ -1476,3 +1476,9 @@ def event_UIA_elementSelected(self):
speech.cancelSpeech()
api.setNavigatorObject(self)
self.reportFocus()
# Construct the braille flash message (name, position info).
# Ideally NvDA objects should have a method to construct braille flash messages.
suggestionMessage=[self.name]
if config.conf["presentation"]["reportObjectPositionInformation"]:
suggestionMessage.append(_("{number} of {total}").format(number=self.positionInfo["indexInGroup"], total=self.positionInfo["similarItemsInGroup"]))
braille.handler.message(" ".join(suggestionMessage))

0 comments on commit e3a8cfc

Please sign in to comment.