Skip to content

Commit 3789121

Browse files
authored
Merge 37b63c0 into 2c33c27
2 parents 2c33c27 + 37b63c0 commit 3789121

2 files changed

Lines changed: 17 additions & 0 deletions

File tree

source/appModules/notepad.py

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -10,11 +10,27 @@
1010
from typing import Optional
1111
import appModuleHandler
1212
import api
13+
import braille
14+
import controlTypes
15+
import eventHandler
16+
import speech
1317
import NVDAObjects
1418

1519

1620
class AppModule(appModuleHandler.AppModule):
1721

22+
def event_UIA_elementSelected(self, obj, nextHandler):
23+
# Announce currently selected tab when it changes.
24+
if (
25+
obj.role == controlTypes.Role.TAB
26+
# this is done because 2 selection events are sent for the same object, so to prevent double speaking.
27+
and not eventHandler.isPendingEvents("UIA_elementSelected") and controlTypes.State.SELECTED in obj.states):
28+
speech.cancelSpeech()
29+
speech.speakObject(obj, reason=controlTypes.OutputReason.FOCUS)
30+
braille.handler.message(braille.getPropertiesBraille(
31+
name=obj.name, role=obj.role, states=obj.states, positionInfo=obj.positionInfo))
32+
nextHandler()
33+
1834
def _get_statusBar(self) -> Optional[NVDAObjects.NVDAObject]:
1935
"""Retrieves Windows 11 Notepad status bar.
2036
In Windows 10 and earlier, status bar can be obtained by looking at the bottom of the screen.

user_docs/en/changes.t2t

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,7 @@ For example, when text has a comment and a footnote associated with it. (#14507,
7979
- Bug fixed when navigating to the first and last column in a table in Firefox (#14554)
8080
- When NVDA is launched with --lang=Windows parameter, it is again possible to open NVDA's General settings dialog. (#14407)
8181
- In newer releases of Windows 11 Notepad, NVDA can once again announce status bar contents. (#14573)
82+
- In newer releases of Windows 11 Notepad, switching between tabs will announce tab name and position. (#14588)
8283
-
8384

8485

0 commit comments

Comments
 (0)