Skip to content

Commit 75493e5

Browse files
authored
Merge 7d44b03 into 021c13d
2 parents 021c13d + 7d44b03 commit 75493e5

2 files changed

Lines changed: 23 additions & 3 deletions

File tree

source/globalCommands.py

Lines changed: 22 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
)
2121

2222
import audioDucking
23+
import copy
2324
import touchHandler
2425
import keyboardHandler
2526
import mouseHandler
@@ -274,15 +275,19 @@ def script_reportCurrentSelection(self,gesture):
274275
except (RuntimeError, NotImplementedError):
275276
info=None
276277
if not info or info.isCollapsed:
277-
speech.speakMessage(_("No selection"))
278+
ui.message(_("No selection"))
278279
else:
279280
scriptCount = scriptHandler.getLastScriptRepeatCount()
281+
selectMessage = speech.speech._getSelectionMessageSpeech(_('%s selected'), info.text)[0]
280282
if scriptCount == 0:
281283
speech.speakTextSelected(info.text)
284+
braille.handler.message(selectMessage)
285+
282286
elif len(info.text) < speech.speech.MAX_LENGTH_FOR_SELECTION_REPORTING:
283287
speech.speakSpelling(info.text, useCharacterDescriptions=scriptCount > 1)
284288
else:
285289
speech.speakTextSelected(info.text)
290+
braille.handler.message(selectMessage)
286291

287292
@script(
288293
# Translators: Input help mode message for report date and time command.
@@ -1159,7 +1164,15 @@ def script_navigatorObject_current(self, gesture: inputCore.InputGesture):
11591164
else:
11601165
api.copyToClip(text, notify=True)
11611166
else:
1162-
speech.speakObject(curObject, reason=controlTypes.OutputReason.QUERY)
1167+
speechList = speech.getObjectSpeech(curObject, reason=controlTypes.OutputReason.QUERY)
1168+
speech.speech.speak(speechList)
1169+
for i in copy.copy(speechList):
1170+
if not isinstance(i, str):
1171+
speechList.remove(i)
1172+
text = ' '.join(speechList)
1173+
1174+
braille.handler.message(text)
1175+
11631176

11641177
@staticmethod
11651178
def _reportLocationText(objs: Tuple[Union[None, NVDAObject, textInfos.TextInfo], ...]) -> None:
@@ -2488,7 +2501,13 @@ def script_reportCurrentFocus(self, gesture: inputCore.InputGesture):
24882501

24892502
repeatCount = scriptHandler.getLastScriptRepeatCount()
24902503
if repeatCount == 0:
2491-
speech.speakObject(focusObject, reason=controlTypes.OutputReason.QUERY)
2504+
speechList = speech.getObjectSpeech(focusObject, reason=controlTypes.OutputReason.QUERY)
2505+
speech.speech.speak(speechList)
2506+
for i in copy.copy(speechList):
2507+
if not isinstance(i, str):
2508+
speechList.remove(i)
2509+
text = ' '.join(speechList)
2510+
braille.handler.message(text)
24922511
else:
24932512
speech.speakSpelling(focusObject.name, useCharacterDescriptions=repeatCount > 1)
24942513

user_docs/en/changes.t2t

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -80,6 +80,7 @@ Users of Poedit 1 are encouraged to update to Poedit 3 if they want to rely on e
8080
- More objects which contain useful text are detected, and text content is displayed in braille. (#15605)
8181
- Contracted braille input works properly again. (#15773, @aaclause)
8282
- Braille is now updated when moving the navigator object between table cells in more situations (#15755, @Emil-18)
83+
- The result of report current focus, current navigator object, and current selection commands is now shown in brraille. (#15844, @Emil-18)
8384
-
8485
- LibreOffice:
8586
- Words deleted using the ``control+backspace`` keyboard shortcut are now also properly announced when the deleted word is followed by whitespace (like spaces and tabs). (#15436, @michaelweghorn)

0 commit comments

Comments
 (0)