Skip to content

Commit 8a570b6

Browse files
authored
Merge ab63606 into e71916d
2 parents e71916d + ab63606 commit 8a570b6

4 files changed

Lines changed: 121 additions & 1 deletion

File tree

source/globalCommands.py

Lines changed: 58 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -312,6 +312,36 @@ 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+
gestures=("kb(desktop):NVDA+control+home", "kb(laptop):NVDA+shift+control+home")
320+
)
321+
def script_FirstValueSynthRing(self, gesture):
322+
settingName = globalVars.settingsRing.currentSettingName
323+
if not settingName:
324+
# Translators: Reported when there are no settings to configure in synth settings ring
325+
# Translators: (example: when there is no setting for language).
326+
ui.message(_("No settings"))
327+
return
328+
settingValue = globalVars.settingsRing.first()
329+
ui.message("%s %s" % (settingName, settingValue))
330+
331+
@script(
332+
# Translators: Input help mode message for set the last value in the synth ring settings.
333+
description=_("Set the last value of the current setting in the synth settings ring"),
334+
category=SCRCAT_SPEECH,
335+
gestures=("kb(desktop):NVDA+control+end", "kb(laptop):NVDA+shift+control+end")
336+
)
337+
def script_LastValueSynthRing(self, gesture):
338+
settingName = globalVars.settingsRing.currentSettingName
339+
if not settingName:
340+
ui.message(_("No settings"))
341+
return
342+
settingValue = globalVars.settingsRing.last()
343+
ui.message("%s %s" % (settingName, settingValue))
344+
315345
@script(
316346
# Translators: Input help mode message for increase synth setting value command.
317347
description=_("Increases the currently active setting in the synth settings ring"),
@@ -321,12 +351,25 @@ def script_dateTime(self,gesture):
321351
def script_increaseSynthSetting(self,gesture):
322352
settingName=globalVars.settingsRing.currentSettingName
323353
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).
325354
ui.message(_("No settings"))
326355
return
327356
settingValue=globalVars.settingsRing.increase()
328357
ui.message("%s %s" % (settingName,settingValue))
329358

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

387+
@script(
388+
# Translators: Input help mode message for quick jump between values backward in the synth settings ring.
389+
description=_("Jumps backward the value of the current active setting in the synth settings ring"),
390+
category=SCRCAT_SPEECH,
391+
gestures=("kb(desktop):NVDA+control+pageDown", "kb(laptop):NVDA+control+shift+pageDown")
392+
)
393+
def script_jumpBackwardSynthSetting(self, gesture):
394+
settingName = globalVars.settingsRing.currentSettingName
395+
if not settingName:
396+
ui.message(_("No settings"))
397+
return
398+
settingValue = globalVars.settingsRing.decrease_4x()
399+
ui.message("%s %s" % (settingName, settingValue))
400+
344401
@script(
345402
# Translators: Input help mode message for next synth setting command.
346403
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 + self.step * 4)
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 - self.step * 4)
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: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,17 @@ 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:
13+
- Desktop: ``CTRL+NVDA+home`` or ``CTRL+NVDA+end``.
14+
- laptop: ``CTRL+shift+NVDA+home`` or ``CTRL+shift+NVDA+end``.
15+
- Jump forward and bacward the current setting of the synth settings ring:
16+
- Desktop: ``CTRL+NVDA+page up`` or ``CTRL+NVDA+page down``.
17+
- laptop: ``CTRL+shift+NVDA+page up`` or ``CTRL+shift+NVDA+page down``.
18+
-
19+
-
20+
-
1021
-
1122

1223

user_docs/en/userGuide.t2t

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -236,8 +236,12 @@ The actual commands will not execute while in input help mode.
236236
|| Name | Desktop key | Laptop key | Description |
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 |
239+
| Set the first value of the current synth setting | ``NVDA+control+home`` | ``NVDA+shift+control+home`` | Set the current speech setting to the first value. E.G. When you're on a rate setting, it will set the rate to 0; when you're on a voice setting, it will set the first voice. |
239240
| 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 |
241+
| 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 5 voices; when you're on slider settings (rate, pitch, etc) it will jump forward the value up to 20% |
240242
| 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 |
243+
| 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 5 voices; when you're on a slider setting, it will jump backward the value up to 20% |
244+
| Set the last value of the current synth setting | ``NVDA+control+end`` | ``NVDA+shift+control+end`` | Set the current speech setting to the last value. E.G. When you're on a rate setting, it will set the rate to 100; when you're on a voice setting, it will set the 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.
@@ -1657,8 +1661,12 @@ If you wish to quickly change speech settings without going to the Speech catego
16571661
|| Name | Desktop key | Laptop key | Description |
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 |
1664+
| Set the first value of the current synth setting | ``NVDA+control+home`` | ``NVDA+shift+control+home`` | Set the current speech setting to the first value. E.G. When you're on a rate setting, it will set the rate to 0; when you're on a voice setting, it will set the first voice. |
16601665
| 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 |
1666+
| 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 5 voices; when you're on slider settings (rate, pitch, etc) it will jump forward the value up to 20% |
16611667
| 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 |
1668+
| 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 5 voices; when you're on a slider setting, it will jump backward the value up to 20% |
1669+
| Set the last value of the current synth setting | ``NVDA+control+end`` | ``NVDA+shift+control+end`` | Set the current speech setting to the last value. E.G. When you're on a rate setting, it will set the rate to 100; when you're on a voice setting, it will set the last voice. |
16621670
%kc:endInclude
16631671

16641672
+++ Braille +++[BrailleSettings]

0 commit comments

Comments
 (0)