prompt: We are currently solving the following issue within our repository. Here is the issue text:
  --- BEGIN ISSUE ---
  No braille feedback in Windows Calculator
  ### Steps to reproduce:
  1. Open Windows Calculator.
  2. Type 2
  3. Type +
  4. Type 3
  5. Type = (or Enter)
  
  Note that the new appmodule listens for the Enter key, but not the equals (=) key. However, both work to display the result. Speech reports the result when you press Enter, but braille provides no feedback regardless of what key you press.
  
  ### Actual behavior:
  The braille display continues to show "Display is 0".
  There are two problems with this:
  1. As you type (without using speech) you cannot verify what you just entered.
  2. Once the result appears, you cannot read it unless you temporarily move the focus away from the display and back again.
  
  ### Expected behavior:
  The braille display shows each number, operator and result as you type.
  
  ### System configuration
  #### NVDA installed/portable/running from source:
  Installed
  
  #### NVDA version:
  2020.4
  
  #### Windows version:
  Version	10.0.19042 Build 19042
  
  #### Name and version of other software in use when reproducing the issue:
  
  #### Other information about your system:
  
  ### Other questions
  #### Does the issue still occur after restarting your computer?
  Yes
  
  #### Have you tried any other versions of NVDA? If so, please report their behaviors.
  Yes, it worked in NVDA 2019.3.
  
  #### If add-ons are disabled, is your problem still occurring?
  Yes
  
  #### Did you try to run the COM registry fixing tool in NVDA menu / tools?
  Yes
  
  --- END ISSUE ---
  
  Below are some code segments, each from a relevant file. One or more of these files may contain bugs.
  --- BEGIN FILES ---
  Path: `source/appModules/calculator.py`
  Content:
  ```
  1 # A part of NonVisual Desktop Access (NVDA)
  2 # Copyright (C) 2020 NV Access Limited, Joseph Lee
  3 # This file is covered by the GNU General Public License.
  4 # See the file COPYING for more details.
  5 
  6 """App module for Windows 10 Calculator"""
  7 
  8 import appModuleHandler
  9 import api
  10 from NVDAObjects.UIA import UIA
  11 import queueHandler
  12 import ui
  13 import scriptHandler
  14 
  15 # #9428: do not announce current values until calculations are done in order to avoid repetitions.
  16 noCalculatorEntryAnnouncements = [
  17 	# Display field with Calculator set to full screen mode.
  18 	"CalculatorResults",
  19 	# In the middle of a calculation expression entry.
  20 	"CalculatorExpression",
  21 	# Results display with Calculator set to compact overlay i.e. always on top mode.
  22 	"CalculatorAlwaysOnTopResults",
  23 	# Calculator expressions with Calculator set to always on top mode.
  24 	"ExpressionContainer",
  25 	# Date range selector.
  26 	"ContentPresenter",
  27 	# Briefly shown when closing date calculation calendar.
  28 	"Light Dismiss",
  29 	# Unit conversion/convert from.
  30 	"Value1",
  31 	# Unit conversion/converts into.
  32 	"Value2",
  33 ]
  34 
  35 
  36 class AppModule(appModuleHandler.AppModule):
  37 
  38 	_shouldAnnounceResult = False
  39 	# Name change says the same thing multiple times for some items.
  40 	_resultsCache = ""
  41 
  42 	def event_nameChange(self, obj, nextHandler):
  43 		if not isinstance(obj, UIA):
  44 			return
  45 		# No, announce value changes immediately except for calculator results and expressions.
  46 		if (
  47 			obj.UIAAutomationId in noCalculatorEntryAnnouncements
  48 			or obj.UIAElement.cachedClassName == "LandmarkTarget"
  49 		):
  50 			self._shouldAnnounceResult = False
  51 		# For the rest:
  52 		elif (
  53 			obj.UIAAutomationId not in noCalculatorEntryAnnouncements
  54 			and obj.name != self._resultsCache
  55 		):
  56 			# For unit conversion, both name change and notification events are fired,
  57 			# although UIA notification event presents much better messages.
  58 			# For date calculation, live region change event is also fired for difference between dates.
  59 			if obj.UIAAutomationId != "DateDiffAllUnitsResultLabel":
  60 				ui.message(obj.name)
  61 			self._resultsCache = obj.name
  62 		if not self._shouldAnnounceResult:
  63 			return
  64 		self._shouldAnnounceResult = False
  65 		nextHandler()
  66 
  67 	def event_UIA_notification(self, obj, nextHandler, activityId=None, **kwargs):
  68 		try:
  69 			shouldAnnounceNotification = (
  70 				obj.previous.UIAAutomationId in
  71 				("numberPad", "UnitConverterRootGrid")
  72 			)
  73 		except AttributeError:
  74 			resultElement = api.getForegroundObject().children[1].lastChild
  75 			# Redesigned in 2019 due to introduction of "always on top" i.e. compact overlay mode.
  76 			if resultElement.UIAElement.cachedClassName != "LandmarkTarget":
  77 				resultElement = resultElement.parent.children[1]
  78 			shouldAnnounceNotification = (
  79 				resultElement
  80 				and resultElement.firstChild
  81 				and resultElement.firstChild.UIAAutomationId not in noCalculatorEntryAnnouncements
  82 			)
  83 		# Display updated activity ID seen when entering calculations should be ignored
  84 		# as as it is redundant if speak typed characters is on.
  85 		if shouldAnnounceNotification or activityId != "DisplayUpdated":
  86 			nextHandler()
  87 
  88 	# A list of native commands to handle calculator result announcement.
  89 	_calculatorResultGestures = ("kb:enter", "kb:numpadEnter", "kb:escape")
  90 
  91 	@scriptHandler.script(gestures=_calculatorResultGestures)
  92 	def script_calculatorResult(self, gesture):
  93 		# To prevent double focus announcement, check where we are.
  94 		focus = api.getFocusObject()
  95 		gesture.send()
  96 		# In redstone, calculator result keeps firing name change,
  97 		# so tell it to do so if and only if enter has been pressed.
  98 		self._shouldAnnounceResult = True
  99 		# Hack: only announce display text when an actual calculator button (usually equals button) is pressed.
  100 		# In redstone, pressing enter does not move focus to equals button.
  101 		if isinstance(focus, UIA):
  102 			if focus.UIAAutomationId in ("CalculatorResults", "CalculatorAlwaysOnTopResults"):
  103 				queueHandler.queueFunction(queueHandler.eventQueue, focus.reportFocus)
  104 			else:
  105 				resultsScreen = api.getForegroundObject().children[1].lastChild
  106 				if isinstance(resultsScreen, UIA) and resultsScreen.UIAElement.cachedClassName == "LandmarkTarget":
  107 					# And no, do not allow focus to move.
  108 					queueHandler.queueFunction(queueHandler.eventQueue, resultsScreen.firstChild.reportFocus)
  109
  ```
  --- END FILES ---
  
  Please first localize the bug based on the issue statement, and then generate a patch according to the `git diff` format fenced by three backticks.
  
  Here is an example:
  
  ```diff
  diff --git a/examples/server_async.py b/examples/server_async.py
  --- a/examples/server_async.py
  +++ b/examples/server_async.py
  @@ -313,4 +313,4 @@
   
   
   if __name__ == "__main__":
  -    asyncio.run(run_async_server("."), debug=True)
  +    asyncio.run(run_async_server(), debug=True)
  diff --git a/examples/server_sync.py b/examples/server_sync.py
  --- a/examples/server_sync.py
  +++ b/examples/server_sync.py
  @@ -313,5 +313,5 @@
   
   
   if __name__ == "__main__":
  -    server = run_sync_server(".")
  +    server = run_sync_server()
       server.shutdown()
  
  ```
  
golden_diff: diff --git a/source/appModules/calculator.py b/source/appModules/calculator.py
  --- a/source/appModules/calculator.py
  +++ b/source/appModules/calculator.py
  @@ -1,5 +1,5 @@
   # A part of NonVisual Desktop Access (NVDA)
  -# Copyright (C) 2020 NV Access Limited, Joseph Lee
  +# Copyright (C) 2020-2021 NV Access Limited, Joseph Lee
   # This file is covered by the GNU General Public License.
   # See the file COPYING for more details.
   
  @@ -11,6 +11,7 @@
   import queueHandler
   import ui
   import scriptHandler
  +import braille
   
   # #9428: do not announce current values until calculations are done in order to avoid repetitions.
   noCalculatorEntryAnnouncements = [
  @@ -64,7 +65,10 @@
   		self._shouldAnnounceResult = False
   		nextHandler()
   
  -	def event_UIA_notification(self, obj, nextHandler, activityId=None, **kwargs):
  +	def event_UIA_notification(self, obj, nextHandler, displayString=None, activityId=None, **kwargs):
  +		# #12268: for "DisplayUpdated", announce display strings in braille and move on.
  +		if activityId == "DisplayUpdated":
  +			braille.handler.message(displayString)
   		try:
   			shouldAnnounceNotification = (
   				obj.previous.UIAAutomationId in
  @@ -86,7 +90,13 @@
   			nextHandler()
   
   	# A list of native commands to handle calculator result announcement.
  -	_calculatorResultGestures = ("kb:enter", "kb:numpadEnter", "kb:escape")
  +	_calculatorResultGestures = (
  +		"kb:enter",
  +		"kb:numpadEnter",
  +		"kb:escape",
  +		"kb:delete",
  +		"kb:numpadDelete"
  +	)
   
   	@scriptHandler.script(gestures=_calculatorResultGestures)
   	def script_calculatorResult(self, gesture):
  @@ -100,9 +110,9 @@
   		# In redstone, pressing enter does not move focus to equals button.
   		if isinstance(focus, UIA):
   			if focus.UIAAutomationId in ("CalculatorResults", "CalculatorAlwaysOnTopResults"):
  -				queueHandler.queueFunction(queueHandler.eventQueue, focus.reportFocus)
  +				queueHandler.queueFunction(queueHandler.eventQueue, ui.message, focus.name)
   			else:
   				resultsScreen = api.getForegroundObject().children[1].lastChild
   				if isinstance(resultsScreen, UIA) and resultsScreen.UIAElement.cachedClassName == "LandmarkTarget":
   					# And no, do not allow focus to move.
  -					queueHandler.queueFunction(queueHandler.eventQueue, resultsScreen.firstChild.reportFocus)
  +					queueHandler.queueFunction(queueHandler.eventQueue, ui.message, resultsScreen.firstChild.name)
  
verification_info: {"golden_diff": "diff --git a/source/appModules/calculator.py b/source/appModules/calculator.py\n--- a/source/appModules/calculator.py\n+++ b/source/appModules/calculator.py\n@@ -1,5 +1,5 @@\n # A part of NonVisual Desktop Access (NVDA)\n-# Copyright (C) 2020 NV Access Limited, Joseph Lee\n+# Copyright (C) 2020-2021 NV Access Limited, Joseph Lee\n # This file is covered by the GNU General Public License.\n # See the file COPYING for more details.\n \n@@ -11,6 +11,7 @@\n import queueHandler\n import ui\n import scriptHandler\n+import braille\n \n # #9428: do not announce current values until calculations are done in order to avoid repetitions.\n noCalculatorEntryAnnouncements = [\n@@ -64,7 +65,10 @@\n \t\tself._shouldAnnounceResult = False\n \t\tnextHandler()\n \n-\tdef event_UIA_notification(self, obj, nextHandler, activityId=None, **kwargs):\n+\tdef event_UIA_notification(self, obj, nextHandler, displayString=None, activityId=None, **kwargs):\n+\t\t# #12268: for \"DisplayUpdated\", announce display strings in braille and move on.\n+\t\tif activityId == \"DisplayUpdated\":\n+\t\t\tbraille.handler.message(displayString)\n \t\ttry:\n \t\t\tshouldAnnounceNotification = (\n \t\t\t\tobj.previous.UIAAutomationId in\n@@ -86,7 +90,13 @@\n \t\t\tnextHandler()\n \n \t# A list of native commands to handle calculator result announcement.\n-\t_calculatorResultGestures = (\"kb:enter\", \"kb:numpadEnter\", \"kb:escape\")\n+\t_calculatorResultGestures = (\n+\t\t\"kb:enter\",\n+\t\t\"kb:numpadEnter\",\n+\t\t\"kb:escape\",\n+\t\t\"kb:delete\",\n+\t\t\"kb:numpadDelete\"\n+\t)\n \n \t@scriptHandler.script(gestures=_calculatorResultGestures)\n \tdef script_calculatorResult(self, gesture):\n@@ -100,9 +110,9 @@\n \t\t# In redstone, pressing enter does not move focus to equals button.\n \t\tif isinstance(focus, UIA):\n \t\t\tif focus.UIAAutomationId in (\"CalculatorResults\", \"CalculatorAlwaysOnTopResults\"):\n-\t\t\t\tqueueHandler.queueFunction(queueHandler.eventQueue, focus.reportFocus)\n+\t\t\t\tqueueHandler.queueFunction(queueHandler.eventQueue, ui.message, focus.name)\n \t\t\telse:\n \t\t\t\tresultsScreen = api.getForegroundObject().children[1].lastChild\n \t\t\t\tif isinstance(resultsScreen, UIA) and resultsScreen.UIAElement.cachedClassName == \"LandmarkTarget\":\n \t\t\t\t\t# And no, do not allow focus to move.\n-\t\t\t\t\tqueueHandler.queueFunction(queueHandler.eventQueue, resultsScreen.firstChild.reportFocus)\n+\t\t\t\t\tqueueHandler.queueFunction(queueHandler.eventQueue, ui.message, resultsScreen.firstChild.name)\n", "issue": "No braille feedback in Windows Calculator\n### Steps to reproduce:\r\n1. Open Windows Calculator.\r\n2. Type 2\r\n3. Type +\r\n4. Type 3\r\n5. Type = (or Enter)\r\n\r\nNote that the new appmodule listens for the Enter key, but not the equals (=) key. However, both work to display the result. Speech reports the result when you press Enter, but braille provides no feedback regardless of what key you press.\r\n\r\n### Actual behavior:\r\nThe braille display continues to show \"Display is 0\".\r\nThere are two problems with this:\r\n1. As you type (without using speech) you cannot verify what you just entered.\r\n2. Once the result appears, you cannot read it unless you temporarily move the focus away from the display and back again.\r\n\r\n### Expected behavior:\r\nThe braille display shows each number, operator and result as you type.\r\n\r\n### System configuration\r\n#### NVDA installed/portable/running from source:\r\nInstalled\r\n\r\n#### NVDA version:\r\n2020.4\r\n\r\n#### Windows version:\r\nVersion\t10.0.19042 Build 19042\r\n\r\n#### Name and version of other software in use when reproducing the issue:\r\n\r\n#### Other information about your system:\r\n\r\n### Other questions\r\n#### Does the issue still occur after restarting your computer?\r\nYes\r\n\r\n#### Have you tried any other versions of NVDA? If so, please report their behaviors.\r\nYes, it worked in NVDA 2019.3.\r\n\r\n#### If add-ons are disabled, is your problem still occurring?\r\nYes\r\n\r\n#### Did you try to run the COM registry fixing tool in NVDA menu / tools?\r\nYes\n", "before_files": [{"content": "# A part of NonVisual Desktop Access (NVDA)\n# Copyright (C) 2020 NV Access Limited, Joseph Lee\n# This file is covered by the GNU General Public License.\n# See the file COPYING for more details.\n\n\"\"\"App module for Windows 10 Calculator\"\"\"\n\nimport appModuleHandler\nimport api\nfrom NVDAObjects.UIA import UIA\nimport queueHandler\nimport ui\nimport scriptHandler\n\n# #9428: do not announce current values until calculations are done in order to avoid repetitions.\nnoCalculatorEntryAnnouncements = [\n\t# Display field with Calculator set to full screen mode.\n\t\"CalculatorResults\",\n\t# In the middle of a calculation expression entry.\n\t\"CalculatorExpression\",\n\t# Results display with Calculator set to compact overlay i.e. always on top mode.\n\t\"CalculatorAlwaysOnTopResults\",\n\t# Calculator expressions with Calculator set to always on top mode.\n\t\"ExpressionContainer\",\n\t# Date range selector.\n\t\"ContentPresenter\",\n\t# Briefly shown when closing date calculation calendar.\n\t\"Light Dismiss\",\n\t# Unit conversion/convert from.\n\t\"Value1\",\n\t# Unit conversion/converts into.\n\t\"Value2\",\n]\n\n\nclass AppModule(appModuleHandler.AppModule):\n\n\t_shouldAnnounceResult = False\n\t# Name change says the same thing multiple times for some items.\n\t_resultsCache = \"\"\n\n\tdef event_nameChange(self, obj, nextHandler):\n\t\tif not isinstance(obj, UIA):\n\t\t\treturn\n\t\t# No, announce value changes immediately except for calculator results and expressions.\n\t\tif (\n\t\t\tobj.UIAAutomationId in noCalculatorEntryAnnouncements\n\t\t\tor obj.UIAElement.cachedClassName == \"LandmarkTarget\"\n\t\t):\n\t\t\tself._shouldAnnounceResult = False\n\t\t# For the rest:\n\t\telif (\n\t\t\tobj.UIAAutomationId not in noCalculatorEntryAnnouncements\n\t\t\tand obj.name != self._resultsCache\n\t\t):\n\t\t\t# For unit conversion, both name change and notification events are fired,\n\t\t\t# although UIA notification event presents much better messages.\n\t\t\t# For date calculation, live region change event is also fired for difference between dates.\n\t\t\tif obj.UIAAutomationId != \"DateDiffAllUnitsResultLabel\":\n\t\t\t\tui.message(obj.name)\n\t\t\tself._resultsCache = obj.name\n\t\tif not self._shouldAnnounceResult:\n\t\t\treturn\n\t\tself._shouldAnnounceResult = False\n\t\tnextHandler()\n\n\tdef event_UIA_notification(self, obj, nextHandler, activityId=None, **kwargs):\n\t\ttry:\n\t\t\tshouldAnnounceNotification = (\n\t\t\t\tobj.previous.UIAAutomationId in\n\t\t\t\t(\"numberPad\", \"UnitConverterRootGrid\")\n\t\t\t)\n\t\texcept AttributeError:\n\t\t\tresultElement = api.getForegroundObject().children[1].lastChild\n\t\t\t# Redesigned in 2019 due to introduction of \"always on top\" i.e. compact overlay mode.\n\t\t\tif resultElement.UIAElement.cachedClassName != \"LandmarkTarget\":\n\t\t\t\tresultElement = resultElement.parent.children[1]\n\t\t\tshouldAnnounceNotification = (\n\t\t\t\tresultElement\n\t\t\t\tand resultElement.firstChild\n\t\t\t\tand resultElement.firstChild.UIAAutomationId not in noCalculatorEntryAnnouncements\n\t\t\t)\n\t\t# Display updated activity ID seen when entering calculations should be ignored\n\t\t# as as it is redundant if speak typed characters is on.\n\t\tif shouldAnnounceNotification or activityId != \"DisplayUpdated\":\n\t\t\tnextHandler()\n\n\t# A list of native commands to handle calculator result announcement.\n\t_calculatorResultGestures = (\"kb:enter\", \"kb:numpadEnter\", \"kb:escape\")\n\n\t@scriptHandler.script(gestures=_calculatorResultGestures)\n\tdef script_calculatorResult(self, gesture):\n\t\t# To prevent double focus announcement, check where we are.\n\t\tfocus = api.getFocusObject()\n\t\tgesture.send()\n\t\t# In redstone, calculator result keeps firing name change,\n\t\t# so tell it to do so if and only if enter has been pressed.\n\t\tself._shouldAnnounceResult = True\n\t\t# Hack: only announce display text when an actual calculator button (usually equals button) is pressed.\n\t\t# In redstone, pressing enter does not move focus to equals button.\n\t\tif isinstance(focus, UIA):\n\t\t\tif focus.UIAAutomationId in (\"CalculatorResults\", \"CalculatorAlwaysOnTopResults\"):\n\t\t\t\tqueueHandler.queueFunction(queueHandler.eventQueue, focus.reportFocus)\n\t\t\telse:\n\t\t\t\tresultsScreen = api.getForegroundObject().children[1].lastChild\n\t\t\t\tif isinstance(resultsScreen, UIA) and resultsScreen.UIAElement.cachedClassName == \"LandmarkTarget\":\n\t\t\t\t\t# And no, do not allow focus to move.\n\t\t\t\t\tqueueHandler.queueFunction(queueHandler.eventQueue, resultsScreen.firstChild.reportFocus)\n", "path": "source/appModules/calculator.py"}], "after_files": [{"content": "# A part of NonVisual Desktop Access (NVDA)\n# Copyright (C) 2020-2021 NV Access Limited, Joseph Lee\n# This file is covered by the GNU General Public License.\n# See the file COPYING for more details.\n\n\"\"\"App module for Windows 10 Calculator\"\"\"\n\nimport appModuleHandler\nimport api\nfrom NVDAObjects.UIA import UIA\nimport queueHandler\nimport ui\nimport scriptHandler\nimport braille\n\n# #9428: do not announce current values until calculations are done in order to avoid repetitions.\nnoCalculatorEntryAnnouncements = [\n\t# Display field with Calculator set to full screen mode.\n\t\"CalculatorResults\",\n\t# In the middle of a calculation expression entry.\n\t\"CalculatorExpression\",\n\t# Results display with Calculator set to compact overlay i.e. always on top mode.\n\t\"CalculatorAlwaysOnTopResults\",\n\t# Calculator expressions with Calculator set to always on top mode.\n\t\"ExpressionContainer\",\n\t# Date range selector.\n\t\"ContentPresenter\",\n\t# Briefly shown when closing date calculation calendar.\n\t\"Light Dismiss\",\n\t# Unit conversion/convert from.\n\t\"Value1\",\n\t# Unit conversion/converts into.\n\t\"Value2\",\n]\n\n\nclass AppModule(appModuleHandler.AppModule):\n\n\t_shouldAnnounceResult = False\n\t# Name change says the same thing multiple times for some items.\n\t_resultsCache = \"\"\n\n\tdef event_nameChange(self, obj, nextHandler):\n\t\tif not isinstance(obj, UIA):\n\t\t\treturn\n\t\t# No, announce value changes immediately except for calculator results and expressions.\n\t\tif (\n\t\t\tobj.UIAAutomationId in noCalculatorEntryAnnouncements\n\t\t\tor obj.UIAElement.cachedClassName == \"LandmarkTarget\"\n\t\t):\n\t\t\tself._shouldAnnounceResult = False\n\t\t# For the rest:\n\t\telif (\n\t\t\tobj.UIAAutomationId not in noCalculatorEntryAnnouncements\n\t\t\tand obj.name != self._resultsCache\n\t\t):\n\t\t\t# For unit conversion, both name change and notification events are fired,\n\t\t\t# although UIA notification event presents much better messages.\n\t\t\t# For date calculation, live region change event is also fired for difference between dates.\n\t\t\tif obj.UIAAutomationId != \"DateDiffAllUnitsResultLabel\":\n\t\t\t\tui.message(obj.name)\n\t\t\tself._resultsCache = obj.name\n\t\tif not self._shouldAnnounceResult:\n\t\t\treturn\n\t\tself._shouldAnnounceResult = False\n\t\tnextHandler()\n\n\tdef event_UIA_notification(self, obj, nextHandler, displayString=None, activityId=None, **kwargs):\n\t\t# #12268: for \"DisplayUpdated\", announce display strings in braille and move on.\n\t\tif activityId == \"DisplayUpdated\":\n\t\t\tbraille.handler.message(displayString)\n\t\ttry:\n\t\t\tshouldAnnounceNotification = (\n\t\t\t\tobj.previous.UIAAutomationId in\n\t\t\t\t(\"numberPad\", \"UnitConverterRootGrid\")\n\t\t\t)\n\t\texcept AttributeError:\n\t\t\tresultElement = api.getForegroundObject().children[1].lastChild\n\t\t\t# Redesigned in 2019 due to introduction of \"always on top\" i.e. compact overlay mode.\n\t\t\tif resultElement.UIAElement.cachedClassName != \"LandmarkTarget\":\n\t\t\t\tresultElement = resultElement.parent.children[1]\n\t\t\tshouldAnnounceNotification = (\n\t\t\t\tresultElement\n\t\t\t\tand resultElement.firstChild\n\t\t\t\tand resultElement.firstChild.UIAAutomationId not in noCalculatorEntryAnnouncements\n\t\t\t)\n\t\t# Display updated activity ID seen when entering calculations should be ignored\n\t\t# as as it is redundant if speak typed characters is on.\n\t\tif shouldAnnounceNotification or activityId != \"DisplayUpdated\":\n\t\t\tnextHandler()\n\n\t# A list of native commands to handle calculator result announcement.\n\t_calculatorResultGestures = (\n\t\t\"kb:enter\",\n\t\t\"kb:numpadEnter\",\n\t\t\"kb:escape\",\n\t\t\"kb:delete\",\n\t\t\"kb:numpadDelete\"\n\t)\n\n\t@scriptHandler.script(gestures=_calculatorResultGestures)\n\tdef script_calculatorResult(self, gesture):\n\t\t# To prevent double focus announcement, check where we are.\n\t\tfocus = api.getFocusObject()\n\t\tgesture.send()\n\t\t# In redstone, calculator result keeps firing name change,\n\t\t# so tell it to do so if and only if enter has been pressed.\n\t\tself._shouldAnnounceResult = True\n\t\t# Hack: only announce display text when an actual calculator button (usually equals button) is pressed.\n\t\t# In redstone, pressing enter does not move focus to equals button.\n\t\tif isinstance(focus, UIA):\n\t\t\tif focus.UIAAutomationId in (\"CalculatorResults\", \"CalculatorAlwaysOnTopResults\"):\n\t\t\t\tqueueHandler.queueFunction(queueHandler.eventQueue, ui.message, focus.name)\n\t\t\telse:\n\t\t\t\tresultsScreen = api.getForegroundObject().children[1].lastChild\n\t\t\t\tif isinstance(resultsScreen, UIA) and resultsScreen.UIAElement.cachedClassName == \"LandmarkTarget\":\n\t\t\t\t\t# And no, do not allow focus to move.\n\t\t\t\t\tqueueHandler.queueFunction(queueHandler.eventQueue, ui.message, resultsScreen.firstChild.name)\n", "path": "source/appModules/calculator.py"}]}