|
20 | 20 | ) |
21 | 21 |
|
22 | 22 | import audioDucking |
| 23 | +import copy |
23 | 24 | import touchHandler |
24 | 25 | import keyboardHandler |
25 | 26 | import mouseHandler |
@@ -274,15 +275,19 @@ def script_reportCurrentSelection(self,gesture): |
274 | 275 | except (RuntimeError, NotImplementedError): |
275 | 276 | info=None |
276 | 277 | if not info or info.isCollapsed: |
277 | | - speech.speakMessage(_("No selection")) |
| 278 | + ui.message(_("No selection")) |
278 | 279 | else: |
279 | 280 | scriptCount = scriptHandler.getLastScriptRepeatCount() |
| 281 | + selectMessage = speech.speech._getSelectionMessageSpeech(_('%s selected'), info.text)[0] |
280 | 282 | if scriptCount == 0: |
281 | 283 | speech.speakTextSelected(info.text) |
| 284 | + braille.handler.message(selectMessage) |
| 285 | + |
282 | 286 | elif len(info.text) < speech.speech.MAX_LENGTH_FOR_SELECTION_REPORTING: |
283 | 287 | speech.speakSpelling(info.text, useCharacterDescriptions=scriptCount > 1) |
284 | 288 | else: |
285 | 289 | speech.speakTextSelected(info.text) |
| 290 | + braille.handler.message(selectMessage) |
286 | 291 |
|
287 | 292 | @script( |
288 | 293 | # Translators: Input help mode message for report date and time command. |
@@ -1159,7 +1164,15 @@ def script_navigatorObject_current(self, gesture: inputCore.InputGesture): |
1159 | 1164 | else: |
1160 | 1165 | api.copyToClip(text, notify=True) |
1161 | 1166 | 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 | + |
1163 | 1176 |
|
1164 | 1177 | @staticmethod |
1165 | 1178 | def _reportLocationText(objs: Tuple[Union[None, NVDAObject, textInfos.TextInfo], ...]) -> None: |
@@ -2488,7 +2501,13 @@ def script_reportCurrentFocus(self, gesture: inputCore.InputGesture): |
2488 | 2501 |
|
2489 | 2502 | repeatCount = scriptHandler.getLastScriptRepeatCount() |
2490 | 2503 | 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) |
2492 | 2511 | else: |
2493 | 2512 | speech.speakSpelling(focusObject.name, useCharacterDescriptions=repeatCount > 1) |
2494 | 2513 |
|
|
0 commit comments