Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 8 additions & 3 deletions source/appModules/calculator.py
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,10 @@
"ContentPresenter",
# Briefly shown when closing date calculation calendar.
"Light Dismiss",
# Unit conversion/convert from.
"Value1",
# Unit conversion/converts into.
"Value2",
]


Expand All @@ -49,9 +53,10 @@ def event_nameChange(self, obj, nextHandler):
obj.UIAAutomationId not in noCalculatorEntryAnnouncements
and obj.name != self._resultsCache
):
# For unit conversion, UIA notification event presents much better messages.
# For unit conversion, both name change and notification events are fired,
# although UIA notification event presents much better messages.
# For date calculation, live region change event is also fired for difference between dates.
if obj.UIAAutomationId not in ("Value1", "Value2", "DateDiffAllUnitsResultLabel"):
if obj.UIAAutomationId != "DateDiffAllUnitsResultLabel":
ui.message(obj.name)
self._resultsCache = obj.name
if not self._shouldAnnounceResult:
Expand Down Expand Up @@ -94,7 +99,7 @@ def script_calculatorResult(self, gesture):
# Hack: only announce display text when an actual calculator button (usually equals button) is pressed.
# In redstone, pressing enter does not move focus to equals button.
if isinstance(focus, UIA):
if focus.UIAAutomationId == "CalculatorResults":
if focus.UIAAutomationId in ("CalculatorResults", "CalculatorAlwaysOnTopResults"):
queueHandler.queueFunction(queueHandler.eventQueue, focus.reportFocus)
else:
resultsScreen = api.getForegroundObject().children[1].lastChild
Expand Down