Skip to content

Commit 2185a6f

Browse files
authored
Merge 46274e4 into 2077431
2 parents 2077431 + 46274e4 commit 2185a6f

5 files changed

Lines changed: 43 additions & 3 deletions

File tree

source/braille.py

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2777,6 +2777,18 @@ def _get_keyNames(self):
27772777
"""
27782778
return self.id.split("+")
27792779

2780+
def _get_speechEffectWhenExecuted(self) -> Optional[str]:
2781+
from globalCommands import GlobalCommands
2782+
if (
2783+
not config.conf["braille"]["interruptSpeechWhileScrolling"]
2784+
and self.script in {
2785+
GlobalCommands.script_braille_scrollBack,
2786+
GlobalCommands.script_braille_scrollForward,
2787+
}
2788+
):
2789+
return None
2790+
return super().speechEffectWhenExecuted
2791+
27802792
#: Compiled regular expression to match an identifier including an optional model name
27812793
#: The model name should be an alphanumeric string without spaces.
27822794
#: @type: RegexObject

source/config/configSpec.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
# -*- coding: UTF-8 -*-
22
# A part of NonVisual Desktop Access (NVDA)
3-
# Copyright (C) 2006-2021 NV Access Limited, Babbage B.V., Davy Kager, Bill Dengler, Julien Cochuyt,
4-
# Joseph Lee, Dawid Pieper, mltony
3+
# Copyright (C) 2006-2022 NV Access Limited, Babbage B.V., Davy Kager, Bill Dengler, Julien Cochuyt,
4+
# Joseph Lee, Dawid Pieper, mltony, Bram Duvigneau
55
# This file is covered by the GNU General Public License.
66
# See the file COPYING for more details.
77

@@ -76,6 +76,7 @@
7676
readByParagraph = boolean(default=false)
7777
wordWrap = boolean(default=true)
7878
focusContextPresentation = option("changedContext", "fill", "scroll", default="changedContext")
79+
interruptSpeechWhileScrolling = featureFlag(optionsEnum="BoolFlag", behaviorOfDefault="enabled")
7980
enableHidBrailleSupport = integer(0, 2, default=0) # 0:Use default/recommended value (yes), 1:yes, 2:no
8081
8182
# Braille display driver settings

source/gui/settingsDialogs.py

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# -*- coding: UTF-8 -*-
22
# A part of NonVisual Desktop Access (NVDA)
3-
# Copyright (C) 2006-2021 NV Access Limited, Peter Vágner, Aleksey Sadovoy,
3+
# Copyright (C) 2006-2022 NV Access Limited, Peter Vágner, Aleksey Sadovoy,
44
# Rui Batista, Joseph Lee, Heiko Folkerts, Zahari Yurukov, Leonard de Ruijter,
55
# Derek Riemer, Babbage B.V., Davy Kager, Ethan Holliger, Bill Dengler, Thomas Stivers,
66
# Julien Cochuyt, Peter Vágner, Cyrille Bougot, Mesar Hameed, Łukasz Golonka, Aaron Cannon,
@@ -3572,6 +3572,18 @@ def makeSettings(self, settingsSizer):
35723572
except:
35733573
index=0
35743574
self.focusContextPresentationList.SetSelection(index)
3575+
3576+
self.brailleInterruptSpeechCombo: nvdaControls.FeatureFlagCombo = sHelper.addLabeledControl(
3577+
labelText=_(
3578+
# Translators: This is a label for a combo-box in the Braille settings panel.
3579+
"I&nterrupt speech while scrolling"
3580+
),
3581+
wxCtrlClass=nvdaControls.FeatureFlagCombo,
3582+
keyPath=["braille", "interruptSpeechWhileScrolling"],
3583+
conf=config.conf,
3584+
)
3585+
self.bindHelpEvent("BrailleSettingsInterruptSpeech", self.brailleInterruptSpeechCombo)
3586+
35753587
if gui._isDebug():
35763588
log.debug("Finished making settings, now at %.2f seconds from start"%(time.time() - startTime))
35773589

@@ -3600,6 +3612,7 @@ def onSave(self):
36003612
config.conf["braille"]["readByParagraph"] = self.readByParagraphCheckBox.Value
36013613
config.conf["braille"]["wordWrap"] = self.wordWrapCheckBox.Value
36023614
config.conf["braille"]["focusContextPresentation"] = self.focusContextPresentationValues[self.focusContextPresentationList.GetSelection()]
3615+
self.brailleInterruptSpeechCombo.saveCurrentValueToConf()
36033616

36043617
def onShowCursorChange(self, evt):
36053618
self.cursorBlinkCheckBox.Enable(evt.IsChecked())

user_docs/en/changes.t2t

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@ It can be re-enabled in NVDA's advanced settings panel. (#11554)
3333
-
3434
- When using UI Automation to access Microsoft Excel spreadsheet controls, NVDA is now able to report when a cell is merged. (#12843)
3535
- Instead of reporting "has details" the purpose of details is included where possible, for example "has comment". (#13649)
36+
- A new Braille option has been added to determine if scrolling the display forward/back should interrupt speech. (#2124)
3637
-
3738

3839

user_docs/en/userGuide.t2t

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1415,6 +1415,19 @@ However, in order for you to read the context (i.e. that you are in a list and t
14151415

14161416
To toggle focus context presentation from anywhere, please assign a custom gesture using the [Input Gestures dialog #InputGestures].
14171417

1418+
==== Interrupt speech while scrolling ====[BrailleSettingsInterruptSpeech]
1419+
: Default
1420+
Enabled
1421+
:
1422+
1423+
This setting determines if speech should be interrupted when the Braille display is scrolled backwards/forwards.
1424+
Previous/next line commands always interrupt speech.
1425+
1426+
On-going speech might be a distraction while reading Braille.
1427+
For this reason the option is enabled by default, interrupting speech when scrolling braille.
1428+
1429+
Disabling this option allows speech to be heard while simultaneously reading Braille.
1430+
14181431
+++ Select Braille Display (NVDA+control+a) +++[SelectBrailleDisplay]
14191432
The Select Braille Display dialog, which can be opened by activating the Change... button in the Braille category of the NVDA settings dialog, allows you to select which Braille display NVDA should use for braille output.
14201433
Once you have selected your braille display of choice, you can press Ok and NVDA will load the selected display.

0 commit comments

Comments
 (0)