Skip to content

Commit 4f6c04f

Browse files
authored
Merge 537a40c into 51aacac
2 parents 51aacac + 537a40c commit 4f6c04f

1 file changed

Lines changed: 21 additions & 0 deletions

File tree

source/appModules/explorer.py

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
import winVersion
1717
import api
1818
import speech
19+
import braille
1920
import eventHandler
2021
import mouseHandler
2122
from NVDAObjects.IAccessible import IAccessible, List
@@ -552,3 +553,23 @@ def event_UIA_window_windowOpen(self, obj, nextHandler):
552553
eventHandler.executeEvent("UIA_window_windowOpen", inputPanelWindow)
553554
return
554555
nextHandler()
556+
557+
def event_UIA_elementSelected(self, obj: NVDAObject, nextHandler: Callable[[], None]):
558+
# #14388: announce File Explorer tab switches (Windows 11 22H2 and later).
559+
if (
560+
obj.role == controlTypes.Role.TAB
561+
and controlTypes.State.SELECTED in obj.states
562+
and obj.parent.UIAAutomationId == "TabListView"
563+
# this is done because 2 selection events are sent for the same object, so to prevent double speaking.
564+
and not eventHandler.isPendingEvents(eventName="UIA_elementSelected")
565+
):
566+
speech.speakObject(obj, reason=controlTypes.OutputReason.FOCUS)
567+
braille.handler.message(
568+
braille.getPropertiesBraille(
569+
name=obj.name,
570+
role=obj.role,
571+
states=obj.states,
572+
positionInfo=obj.positionInfo
573+
)
574+
)
575+
nextHandler()

0 commit comments

Comments
 (0)