Skip to content

Commit ac2dd66

Browse files
authored
Merge b1c6435 into 7402acd
2 parents 7402acd + b1c6435 commit ac2dd66

2 files changed

Lines changed: 29 additions & 5 deletions

File tree

source/globalCommands.py

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

2222
import audioDucking
23+
2324
import touchHandler
2425
import keyboardHandler
2526
import mouseHandler
@@ -258,7 +259,8 @@ def script_toggleRightMouseButton(self,gesture):
258259
# Translators: Input help mode message for report current selection command.
259260
"Announces the current selection in edit controls and documents. "
260261
"Pressing twice spells this information. "
261-
"Pressing three times spells it using character descriptions."
262+
"Pressing three times spells it using character descriptions. "
263+
"Pressing four times shows it in a browseable message."
262264
),
263265
category=SCRCAT_SYSTEMCARET,
264266
gestures=("kb(desktop):NVDA+shift+upArrow", "kb(laptop):NVDA+shift+s"),
@@ -274,15 +276,25 @@ def script_reportCurrentSelection(self,gesture):
274276
except (RuntimeError, NotImplementedError):
275277
info=None
276278
if not info or info.isCollapsed:
277-
speech.speakMessage(_("No selection"))
279+
# Translators: The message reported when there is no selection
280+
ui.message(_("No selection"))
278281
else:
279282
scriptCount = scriptHandler.getLastScriptRepeatCount()
283+
# Translators: The message reported after selected text
284+
selectMessage = speech.speech._getSelectionMessageSpeech(_('%s selected'), info.text)[0]
280285
if scriptCount == 0:
281286
speech.speakTextSelected(info.text)
287+
braille.handler.message(selectMessage)
288+
289+
elif scriptCount == 3:
290+
ui.browseableMessage(info.text)
291+
return
292+
282293
elif len(info.text) < speech.speech.MAX_LENGTH_FOR_SELECTION_REPORTING:
283294
speech.speakSpelling(info.text, useCharacterDescriptions=scriptCount > 1)
284295
else:
285296
speech.speakTextSelected(info.text)
297+
braille.handler.message(selectMessage)
286298

287299
@script(
288300
# Translators: Input help mode message for report date and time command.
@@ -1159,7 +1171,12 @@ def script_navigatorObject_current(self, gesture: inputCore.InputGesture):
11591171
else:
11601172
api.copyToClip(text, notify=True)
11611173
else:
1162-
speech.speakObject(curObject, reason=controlTypes.OutputReason.QUERY)
1174+
speechList = speech.getObjectSpeech(curObject, reason=controlTypes.OutputReason.QUERY)
1175+
speech.speech.speak(speechList)
1176+
text = ' '.join(s for s in speechList if isinstance(s, str))
1177+
1178+
braille.handler.message(text)
1179+
11631180

11641181
@staticmethod
11651182
def _reportLocationText(objs: Tuple[Union[None, NVDAObject, textInfos.TextInfo], ...]) -> None:
@@ -2488,7 +2505,12 @@ def script_reportCurrentFocus(self, gesture: inputCore.InputGesture):
24882505

24892506
repeatCount = scriptHandler.getLastScriptRepeatCount()
24902507
if repeatCount == 0:
2491-
speech.speakObject(focusObject, reason=controlTypes.OutputReason.QUERY)
2508+
speechList = speech.getObjectSpeech(focusObject, reason=controlTypes.OutputReason.QUERY)
2509+
speech.speech.speak(speechList)
2510+
brailleList = speechList.copy()
2511+
text = ' '.join(s for s in speechList if isinstance(s, str))
2512+
2513+
braille.handler.message(text)
24922514
else:
24932515
speech.speakSpelling(focusObject.name, useCharacterDescriptions=repeatCount > 1)
24942516

user_docs/en/changes.t2t

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -48,7 +48,8 @@ Windows 8.1 is the minimum Windows version supported. (#15544)
4848
- Key Commands:
4949
- The following commands now support two and three presses to spell the reported information and spell with character descriptions: report selection, report clipboard text and report focused object. (#15449, @CyrilleB79)
5050
- The command to toggle the screen curtain now has a default gesture: ``NVDA+control+escape``. (#10560, @CyrilleB79)
51-
-
51+
- When pressed four times, the report selection command now shows the selection in a browseable message(@Emil-18)
52+
-
5253
- Microsoft Office:
5354
- When requesting formatting information on Excel cells, borders and background will only be reported if there is such formatting. (#15560, @CyrilleB79)
5455
- NVDA will again no longer report unlabelled groupings such as in recent versions of Microsoft Office 365 menus. (#15638)
@@ -82,6 +83,7 @@ Users of Poedit 1 are encouraged to update to Poedit 3 if they want to rely on e
8283
- More objects which contain useful text are detected, and text content is displayed in braille. (#15605)
8384
- Contracted braille input works properly again. (#15773, @aaclause)
8485
- Braille is now updated when moving the navigator object between table cells in more situations (#15755, @Emil-18)
86+
- The result of reporting current focus, current navigator object, and current selection commands is now shown in braille. (#15844, @Emil-18)
8587
-
8688
- LibreOffice:
8789
- 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)