Skip to content

Commit ed195b1

Browse files
authored
Merge a71477f into e71916d
2 parents e71916d + a71477f commit ed195b1

4 files changed

Lines changed: 115 additions & 1 deletion

File tree

source/globalCommands.py

Lines changed: 56 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,34 @@ def script_dateTime(self,gesture):
312312
text=winKernel.GetDateFormatEx(winKernel.LOCALE_NAME_USER_DEFAULT, winKernel.DATE_LONGDATE, None, None)
313313
ui.message(text)
314314

315+
@script(
316+
# Translators: Input help mode message for set the first value in the synth ring setting.
317+
description=_("Set the first value of the current setting in the synth settings ring"),
318+
category=SCRCAT_SPEECH
319+
)
320+
def script_FirstValueSynthRing(self, gesture):
321+
settingName = globalVars.settingsRing.currentSettingName
322+
if not settingName:
323+
# Translators: Reported when there are no settings to configure in synth settings ring
324+
# Translators: (example: when there is no setting for language).
325+
ui.message(_("No settings"))
326+
return
327+
settingValue = globalVars.settingsRing.first()
328+
ui.message("%s %s" % (settingName, settingValue))
329+
330+
@script(
331+
# Translators: Input help mode message for set the last value in the synth ring settings.
332+
description=_("Set the last value of the current setting in the synth settings ring"),
333+
category=SCRCAT_SPEECH
334+
)
335+
def script_LastValueSynthRing(self, gesture):
336+
settingName = globalVars.settingsRing.currentSettingName
337+
if not settingName:
338+
ui.message(_("No settings"))
339+
return
340+
settingValue = globalVars.settingsRing.last()
341+
ui.message("%s %s" % (settingName, settingValue))
342+
315343
@script(
316344
# Translators: Input help mode message for increase synth setting value command.
317345
description=_("Increases the currently active setting in the synth settings ring"),
@@ -321,12 +349,25 @@ def script_dateTime(self,gesture):
321349
def script_increaseSynthSetting(self,gesture):
322350
settingName=globalVars.settingsRing.currentSettingName
323351
if not settingName:
324-
# Translators: Reported when there are no settings to configure in synth settings ring (example: when there is no setting for language).
325352
ui.message(_("No settings"))
326353
return
327354
settingValue=globalVars.settingsRing.increase()
328355
ui.message("%s %s" % (settingName,settingValue))
329356

357+
@script(
358+
# Translators: Input help mode message for quick jump between values forward in the synth settings ring.
359+
description=_("Jumps forward the value of the current active setting in the synth settings ring"),
360+
category=SCRCAT_SPEECH,
361+
gestures=("kb(desktop):NVDA+control+pageUp", "kb(laptop):NVDA+shift+control+pageUp")
362+
)
363+
def script_jumpForwardSynthSetting(self, gesture):
364+
settingName = globalVars.settingsRing.currentSettingName
365+
if not settingName:
366+
ui.message(_("No settings"))
367+
return
368+
settingValue = globalVars.settingsRing.increase_4x()
369+
ui.message("%s %s" % (settingName, settingValue))
370+
330371
@script(
331372
# Translators: Input help mode message for decrease synth setting value command.
332373
description=_("Decreases the currently active setting in the synth settings ring"),
@@ -341,6 +382,20 @@ def script_decreaseSynthSetting(self,gesture):
341382
settingValue=globalVars.settingsRing.decrease()
342383
ui.message("%s %s" % (settingName,settingValue))
343384

385+
@script(
386+
# Translators: Input help mode message for quick jump between values backward in the synth settings ring.
387+
description=_("Jumps backward the value of the current active setting in the synth settings ring"),
388+
category=SCRCAT_SPEECH,
389+
gestures=("kb(desktop):NVDA+control+pageDown", "kb(laptop):NVDA+control+shift+pageDown")
390+
)
391+
def script_jumpBackwardSynthSetting(self, gesture):
392+
settingName = globalVars.settingsRing.currentSettingName
393+
if not settingName:
394+
ui.message(_("No settings"))
395+
return
396+
settingValue = globalVars.settingsRing.decrease_4x()
397+
ui.message("%s %s" % (settingName, settingValue))
398+
344399
@script(
345400
# Translators: Input help mode message for next synth setting command.
346401
description=_("Moves to the next available setting in the synth settings ring"),

source/synthSettingsRing.py

Lines changed: 44 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,16 +14,36 @@ def __init__(self,synth,setting,min=0,max=100):
1414
self.max = setting.maxVal if isinstance(setting, NumericDriverSetting) else max
1515
self.step = setting.normalStep if isinstance(setting, NumericDriverSetting) else 1
1616

17+
def first(self):
18+
val = self.min
19+
self.value = val
20+
return self._getReportValue(val)
21+
22+
def last(self):
23+
val = self.max
24+
self.value = val
25+
return self._getReportValue(val)
26+
1727
def increase(self):
1828
val = min(self.max,self.value+self.step)
1929
self.value = val
2030
return self._getReportValue(val)
2131

32+
def increase_4x(self):
33+
val = min(self.max, self.value + setting.largeStep * 2)
34+
self.value = val
35+
return self._getReportValue(val)
36+
2237
def decrease(self):
2338
val = max(self.min,self.value-self.step)
2439
self.value = val
2540
return self._getReportValue(val)
2641

42+
def decrease_4x(self):
43+
val = max(self.min, self.value - setting.normalStep * 2)
44+
self.value = val
45+
return self._getReportValue(val)
46+
2747
def _get_value(self):
2848
return getattr(self.synth,self.setting.id)
2949

@@ -124,18 +144,42 @@ def previous(self):
124144
return self.currentSettingName
125145
return None
126146

147+
def first(self):
148+
""" set the current setting to the first value """
149+
if self._current is not None:
150+
return self.settings[self._current].first()
151+
return None
152+
153+
def last(self):
154+
""" set the current setting to the last value """
155+
if self._current is not None:
156+
return self.settings[self._current].last()
157+
return None
158+
127159
def increase(self):
128160
""" increases the currentSetting and returns its new value """
129161
if self._current is not None:
130162
return self.settings[self._current].increase()
131163
return None
132164

165+
def increase_4x(self):
166+
""" jumps forward the currentSetting (by a multiplier 4x) and returns its new value """
167+
if self._current is not None:
168+
return self.settings[self._current].increase_4x()
169+
return None
170+
133171
def decrease(self):
134172
""" decreases the currentSetting and returns its new value """
135173
if self._current is not None:
136174
return self.settings[self._current].decrease()
137175
return None
138176

177+
def decrease_4x(self):
178+
""" jumps backward the currentSetting (by a multiplier of 4x) and returns its new value """
179+
if self._current is not None:
180+
return self.settings[self._current].decrease_4x()
181+
return None
182+
139183
def updateSupportedSettings(self,synth):
140184
import ui
141185
from scriptHandler import _isScriptRunning

user_docs/en/changes.t2t

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,15 @@ What's New in NVDA
77

88
== New Features ==
99
- In Windows 11, NVDA will announce alerts from voice typing and suggested actions including the top suggestion when copying data such as phone numbers to the clipboard (Windows 11 2022 Update and later). (#16009, @josephsl)
10+
- New input gestures:
11+
- Added gestures to jump first, last, forward and backward the values through the synth settings ring. (#13768, #16095, @rmcpantoja)
12+
- set the first/last setting to the synth settings ring: unassigned gestures.
13+
- Jump forward and bacward the current setting of the synth settings ring:
14+
- Desktop: ``CTRL+NVDA+page up`` or ``CTRL+NVDA+page down``.
15+
- laptop: ``CTRL+shift+NVDA+page up`` or ``CTRL+shift+NVDA+page down``.
16+
-
17+
-
18+
-
1019
-
1120

1221

user_docs/en/userGuide.t2t

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -237,7 +237,11 @@ The actual commands will not execute while in input help mode.
237237
| Move to next synth setting | ``NVDA+control+rightArrow`` | ``NVDA+shift+control+rightArrow`` | Moves to the next available speech setting after the current, wrapping around to the first setting again after the last |
238238
| Move to previous synth setting | ``NVDA+control+leftArrow`` | ``NVDA+shift+control+leftArrow`` | Moves to the next available speech setting before the current, wrapping around to the last setting after the first |
239239
| Increment current synth setting | ``NVDA+control+upArrow`` | ``NVDA+shift+control+upArrow`` | increases the current speech setting you are on. E.g. increases the rate, chooses the next voice, increases the volume |
240+
| Jump forward the current synth setting | ``NVDA+control+pageUp`` | ``NVDA+shift+control+pageUp`` | Jumps forward the value of the current speech setting you're on. E.G. When you're on a voice setting, it will jump forward every 20 voices; when you're on slider settings (rate, pitch, etc) it will jump forward the value up to 20% |
240241
| Decrement current synth setting | ``NVDA+control+downArrow`` | ``NVDA+shift+control+downArrow`` | decreases the current speech setting you are on. E.g. decreases the rate, chooses the previous voice, decreases the volume |
242+
| Jump backward the current synth setting | ``NVDA+control+pageDown`` | ``NVDA+shift+control+pageDown`` | Jumps backward the value of the current speech setting you're on. E.G. When you're on a voice setting, it will jump backward every 20 voices; when you're on a slider setting, it will jump backward the value up to 20% |
243+
244+
It is also possible to set the first or last value of the current synth setting by assign custom gestures in [Input Gestures dialog #InputGestures], under the speech category. This means, for example, when you're on a rate setting, it will set the rate to 0 or 100; when you're on a voice setting, it will set the first or last voice.
241245

242246
+++ Web navigation +++[WebNavigation]
243247
The full list of Single Letter Navigation keys is in the [Browse Mode #BrowseMode] section of the user guide.
@@ -1658,7 +1662,9 @@ If you wish to quickly change speech settings without going to the Speech catego
16581662
| Move to next synth setting | NVDA+control+rightArrow | NVDA+shift+control+rightArrow | Moves to the next available speech setting after the current, wrapping around to the first setting again after the last |
16591663
| Move to previous synth setting | NVDA+control+leftArrow | NVDA+shift+control+leftArrow | Moves to the next available speech setting before the current, wrapping around to the last setting after the first |
16601664
| Increment current synth setting | NVDA+control+upArrow | NVDA+shift+control+upArrow | increases the current speech setting you are on. E.g. increases the rate, chooses the next voice, increases the volume |
1665+
| Jump forward the current synth setting | ``NVDA+control+pageUp`` | ``NVDA+shift+control+pageUp`` | Jumps forward the value of the current speech setting you're on. E.G. When you're on a voice setting, it will jump forward every 20 voices; when you're on slider settings (rate, pitch, etc) it will jump forward the value up to 20% |
16611666
| Decrement current synth setting | NVDA+control+downArrow | NVDA+shift+control+downArrow | decreases the current speech setting you are on. E.g. decreases the rate, chooses the previous voice, decreases the volume |
1667+
| Jump backward the current synth setting | ``NVDA+control+pageDown`` | ``NVDA+shift+control+pageDown`` | Jumps backward the value of the current speech setting you're on. E.G. When you're on a voice setting, it will jump backward every 20 voices; when you're on a slider setting, it will jump backward the value up to 20% |
16621668
%kc:endInclude
16631669

16641670
+++ Braille +++[BrailleSettings]

0 commit comments

Comments
 (0)