Skip to content

Commit 462122a

Browse files
committed
update buildVars version. now is v0.3a1.
update avdanced settings dialog, now is more usable and added more settings. add developerNotes and deleted this information for developers from main readme. update translation strings template. update spanish languaje strings. update english readme.
1 parent a25fd8d commit 462122a

File tree

8 files changed

+215
-118
lines changed

8 files changed

+215
-118
lines changed

addon/doc/es/readme.md

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@ Este paquete es distribuido bajo los términos de la GNU General Public License,
1212
* Pitar para caracteres escritos cuando la tecla shift es presionada: con esta característica NVDA pitará si escribes un carácter con la tecla shift presionada.
1313
* Pitar cuando cambia el estado de las teclas interruptores: con esta característica, NVDA producirá un tono alto cuando el interructor se activa, y uno bajo si se desactiva.
1414
* Anunciar el cambio de estado de las teclas interruptores: Solo para cuando "Pitar cuando cambia el estado de las teclas" está habilitado. Puedes habilitar o deshabilitar el anunciado de las teclas interruptores cuando estas cambian su estado.
15+
* pitar para caracteres específicos: en las opciones avanzadas, puedes configurar NVDA para que emita un pitido con los caracteres que desees.
1516

1617
## Requisitos
1718
Necesitarás NVDA 2018.2 o posterior.
@@ -22,9 +23,3 @@ Este paquete es distribuido bajo los términos de la GNU General Public License,
2223
## Uso
2324
Para desactivar o activar características, ve a las configuraciones de NVDA y selecciona la categoría beep keyboard. En esa categoría podrás habilitar o deshabilitar cualquier característica soportada por este complemento.
2425
"Pitar para mayúsculas cuando el bloqueo mayúsculas está activado" está habilitado por defecto.
25-
26-
## Empaquetar el complemento para su distribución
27-
  Abra una línea de comandos, cambie al directorio raíz del complemento y ejecute el comando scons. El complemento creado, si no hay errores, será puesto en la carpeta raíz del complemento.
28-
29-
## Notas:
30-
* Las herramientas scons y gettext de este proyecto son compatibles con python 3 únicamente. No funcionan en python 2.7

addon/doc/fr/readme.md

Lines changed: 0 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -22,9 +22,3 @@ Ce paquet est distribué sous les termes de la licence publique générale GNU,
2222
## Utilisation
2323
Pour activer ou désactiver des fonctionnalités, accédez aux paramètres NVDA et sélectionnez la catégorie beep keyboard. Dans cette catégorie, vous pouvez configurer toutes les fonctionnalités prises en charge par l'extension.
2424
"Bip pour les majuscules quand le verrouillage majuscule est activé" est activé par défaut.
25-
26-
## Empaquetage de l'extension pour sa distribution
27-
Ouvrez une ligne de commande, changer le dossier racine de l'extension et exécutez la commande scons. L'extension créée, s'il n'y a pas d'erreur, sera placée dans le dossier racine de l'extension.
28-
29-
## Notes:
30-
* Les outils scons et gettext sur ce projet sont uniquement compatibles avec Python 3. Ils ne fonctionnent pas avec Python 2.7.

addon/globalPlugins/beepKeyboard.py

Lines changed: 71 additions & 56 deletions
Original file line numberDiff line numberDiff line change
@@ -15,25 +15,25 @@
1515
"announceToggleStatus": "boolean(default=True)",
1616
"ignoredCharactersForShift": "string(default='\t\b\r ')",
1717
"beepForCharacters": "string(default='')",
18-
"shiftedCharactersPitch": "integer(default=6000)",
19-
"shiftedCharactersLength": "integer(default=10)",
20-
"shiftedCharactersVolume": "integer(default=25)",
21-
"customCharactersPitch": "integer(default=6000)",
22-
"customCharactersLength": "integer(default=10)",
23-
"customCharactersVolume": "integer(default=25)",
24-
"capsLockUpperPitch": "integer(default=3000)",
25-
"toggleOffPitch": "integer(default=1000)",
26-
"toggleOnPitch": "integer(default=2000)"
18+
"shiftedCharactersTone": "int_list(default=list(6000,10,25))",
19+
"customCharactersTone": "int_list(default=list(6000,10,25))",
20+
"capsLockUpperTone": "int_list(default=list(3000,40,50))",
21+
"toggleOffTone": "int_list(default=list(1000,40,50))",
22+
"toggleOnTone": "int_list(default=list(2000, 40, 50))",
2723
}
2824
config.conf.spec["beepKeyboard"] = confspec
2925

26+
def beep(l):
27+
""" it receives a list with three arguments to beep: [pitch, length, volume]"""
28+
tones.beep(*l, right=l[-1])
29+
3030
#saves the original _reportToggleKey function
3131
origReportToggleKey = keyboardHandler.KeyboardInputGesture._reportToggleKey
3232
# alternate function to report state key.
3333
def _reportToggleKey(self):
3434
if winUser.getKeyState(self.vkCode) & 1:
35-
tones.beep(config.conf['beepKeyboard']['toggleOnPitch'], 40)
36-
else: tones.beep(config.conf['beepKeyboard']['toggleOffPitch'], 40)
35+
beep(config.conf['beepKeyboard']['toggleOnTone'])
36+
else: beep(config.conf['beepKeyboard']['toggleOffTone'])
3737
if config.conf['beepKeyboard']['announceToggleStatus']: origReportToggleKey(self)
3838

3939
class BeepKeyboardSettingsPanel(gui.SettingsPanel):
@@ -54,9 +54,10 @@ def makeSettings(self, settingsSizer):
5454
# Translators: label for a checkbox option in the settings panel.
5555
self.announceToggleStatus = sHelper.addItem(wx.CheckBox(self, label=_("&Announce toggle keys changes (if Beep for toggle keys changes is disabled NVDA will have the original behavior)")))
5656
self.announceToggleStatus.SetValue(config.conf['beepKeyboard']['announceToggleStatus'])
57-
58-
self.advancedButton = sHelper.addItem (wx.Button (self, label = _("&Open advanced options")))
59-
self.advancedButton.Bind(wx.EVT_BUTTON, self.onAdvanced)
57+
58+
# Translators: label for a button to open advanced settings dialog in the settings panel.
59+
advancedButton = sHelper.addItem (wx.Button (self, label = _("&Open advanced options")))
60+
advancedButton.Bind(wx.EVT_BUTTON, self.onAdvanced)
6061

6162
def onAdvanced(self, evt):
6263
advanced = AdvancedBeepKeyboardSettingsDialog(self, multiInstanceAllowed=True)
@@ -78,56 +79,72 @@ class AdvancedBeepKeyboardSettingsDialog(gui.SettingsDialog):
7879

7980
def makeSettings(self, settingsSizer):
8081
sHelper = gui.guiHelper.BoxSizerHelper(self, sizer=settingsSizer)
82+
co = config.conf['beepKeyboard']
8183
# Translators: label for an edit text control option in the advanced settings dialog.
82-
self.ignoredCharactersForShift = sHelper.addLabeledControl(_("Ignored characters with shift pressed"), wx.TextCtrl)
83-
self.ignoredCharactersForShift.SetValue(config.conf['beepKeyboard']['ignoredCharactersForShift'])
84-
# Translators: label for an edit text control option in the advanced settings dialog.
85-
self.beepForCharacters = sHelper.addLabeledControl(_("beep always for the following characters"), wx.TextCtrl)
86-
self.beepForCharacters.SetValue(config.conf['beepKeyboard']['beepForCharacters'])
87-
# Translators: label for an edit text control option in the advanced settings dialog.
88-
self.shiftedCharactersPitch = sHelper.addLabeledControl(_("shifted characters tone pitch"), wx.TextCtrl)
89-
self.shiftedCharactersPitch.SetValue(str(config.conf['beepKeyboard']['shiftedCharactersPitch']))
90-
# Translators: label for an edit text control option in the advanced settings dialog.
91-
self.shiftedCharactersLength = sHelper.addLabeledControl(_("shifted characters tone length"), wx.TextCtrl)
92-
self.shiftedCharactersLength.SetValue(str(config.conf['beepKeyboard']['shiftedCharactersLength']))
93-
# Translators: label for an edit text control option in the advanced settings dialog.
94-
self.shiftedCharactersVolume = sHelper.addLabeledControl(_("shifted characters tone volume"), wx.TextCtrl)
95-
self.shiftedCharactersVolume.SetValue(str(config.conf['beepKeyboard']['shiftedCharactersVolume']))
84+
self.ignoredCharactersForShift = sHelper.addLabeledControl(_("&Ignored characters with shift pressed"), wx.TextCtrl)
85+
self.ignoredCharactersForShift.SetValue(co['ignoredCharactersForShift'])
9686
# Translators: label for an edit text control option in the advanced settings dialog.
97-
self.customCharactersPitch = sHelper.addLabeledControl(_("Custom characters tone pitch"), wx.TextCtrl)
98-
self.customCharactersPitch.SetValue(str(config.conf['beepKeyboard']['customCharactersPitch']))
99-
# Translators: label for an edit text control option in the advanced settings dialog.
100-
self.customCharactersLength = sHelper.addLabeledControl(_("Custom characters tone length"), wx.TextCtrl)
101-
self.customCharactersLength.SetValue(str(config.conf['beepKeyboard']['customCharactersLength']))
102-
# Translators: label for an edit text control option in the advanced settings dialog.
103-
self.customCharactersVolume = sHelper.addLabeledControl(_("Custom characters tone volume"), wx.TextCtrl)
104-
self.customCharactersVolume.SetValue(str(config.conf['beepKeyboard']['customCharactersVolume']))
87+
self.beepForCharacters = sHelper.addLabeledControl(_("Beep &always for the following characters"), wx.TextCtrl)
88+
self.beepForCharacters.SetValue(co['beepForCharacters'])
89+
90+
self.tonesParameters = [co['shiftedCharactersTone'], co['customCharactersTone'], co['capsLockUpperTone'], co['toggleOffTone'], co['toggleOnTone']]
91+
# Translators: label for a combo box control in the advanced settings dialog.
92+
self.toneOptionsList = sHelper.addLabeledControl(_("&Select tone to configure"), wx.Choice, choices=[
93+
# Translators: label for an option of a combo box control.
94+
_("Typed characters with shift pressed"),
95+
# Translators: label for an option of a combo box control.
96+
_("Custom characters"),
97+
# Translators: label for an option of a combo box control.
98+
_("Typed characters when caps lock is on"),
99+
# Translators: label for an option of a combo box control.
100+
_("Toggle key goes off"),
101+
# Translators: label for an option of a combo box control.
102+
_("Toggle key goes on")])
103+
self.toneOptionsList.SetSelection(0)
104+
self.curSelection=0
105+
self.toneOptionsList.Bind(wx.EVT_CHOICE, self.onToneOptionChange)
105106
# Translators: label for an edit text control option in the advanced settings dialog.
106-
self.capsLockUpperPitch = sHelper.addLabeledControl(_("Caps lock on typed characters tone pitch"), wx.TextCtrl)
107-
self.capsLockUpperPitch.SetValue(str(config.conf['beepKeyboard']['capsLockUpperPitch']))
107+
self.tonePitch = sHelper.addLabeledControl(_("Tone &pitch"), wx.TextCtrl)
108+
self.tonePitch.SetValue(str(self.tonesParameters[0][0]))
108109
# Translators: label for an edit text control option in the advanced settings dialog.
109-
self.toggleOffPitch = sHelper.addLabeledControl(_("toggle off tone pitch"), wx.TextCtrl)
110-
self.toggleOffPitch.SetValue(str(config.conf['beepKeyboard']['toggleOffPitch']))
110+
self.toneLength = sHelper.addLabeledControl(_("Tone &length"), wx.TextCtrl)
111+
self.toneLength.SetValue(str(self.tonesParameters[0][1]))
111112
# Translators: label for an edit text control option in the advanced settings dialog.
112-
self.toggleOnPitch = sHelper.addLabeledControl(_("toggle on tone pitch"), wx.TextCtrl)
113-
self.toggleOnPitch.SetValue(str(config.conf['beepKeyboard']['toggleOnPitch']))
113+
self.toneVolume = sHelper.addLabeledControl(_("Tone &volume"), wx.TextCtrl)
114+
self.toneVolume.SetValue(str(self.tonesParameters[0][2]))
115+
# Translators: label for a button to play demo tone in advanced settings dialog.
116+
testButton = sHelper.addItem (wx.Button (self, label = _("&Test tone")))
117+
testButton.Bind(wx.EVT_BUTTON, self.onTest)
114118

115119
def postInit(self):
116120
# ensure that focus is on the ignoredCharactersForShift
117121
self.ignoredCharactersForShift.SetFocus()
118122

123+
def updateCurrentToneValues(self):
124+
self.tonesParameters[self.curSelection] = [int(self.tonePitch.GetValue()), int(self.toneLength.GetValue()), int(self.toneVolume.GetValue())]
125+
126+
def onTest(self, evt):
127+
self.updateCurrentToneValues()
128+
beep(self.tonesParameters[self.curSelection])
129+
130+
def onToneOptionChange(self, evt):
131+
self.updateCurrentToneValues()
132+
self.curSelection = self.toneOptionsList.GetCurrentSelection()
133+
co = self.tonesParameters[self.curSelection][0:3]
134+
beep(co)
135+
self.tonePitch.SetValue(str(co[0]))
136+
self.toneLength.SetValue(str(co[1]))
137+
self.toneVolume.SetValue(str(co[2]))
138+
119139
def onOk(self, evt):
120140
config.conf['beepKeyboard']['ignoredCharactersForShift'] = self.ignoredCharactersForShift.GetValue()
121141
config.conf['beepKeyboard']['beepForCharacters'] = self.beepForCharacters.GetValue()
122-
config.conf['beepKeyboard']['shiftedCharactersPitch'] = self.shiftedCharactersPitch.GetValue()
123-
config.conf['beepKeyboard']['shiftedCharactersLength'] = self.shiftedCharactersLength.GetValue()
124-
config.conf['beepKeyboard']['shiftedCharactersVolume'] = self.shiftedCharactersVolume.GetValue()
125-
config.conf['beepKeyboard']['customCharactersPitch'] = self.customCharactersPitch.GetValue()
126-
config.conf['beepKeyboard']['"customCharactersLength'] = self.customCharactersLength.GetValue()
127-
config.conf['beepKeyboard']['"customCharactersVolume'] = self.customCharactersVolume.GetValue()
128-
config.conf['beepKeyboard']['capsLockUpperPitch'] = self.capsLockUpperPitch.GetValue()
129-
config.conf['beepKeyboard']['toggleOffPitch'] = self.toggleOffPitch.GetValue()
130-
config.conf['beepKeyboard']['toggleOnPitch'] = self.toggleOnPitch.GetValue()
142+
self.updateCurrentToneValues()
143+
config.conf['beepKeyboard']['shiftedCharactersTone'] = self.tonesParameters[0]
144+
config.conf['beepKeyboard']['customCharactersTone'] = self.tonesParameters[1]
145+
config.conf['beepKeyboard']['capsLockUpperTone'] = self.tonesParameters[2]
146+
config.conf['beepKeyboard']['toggleOffTone'] = self.tonesParameters[3]
147+
config.conf['beepKeyboard']['toggleOnTone'] = self.tonesParameters[4]
131148
if hasattr(config, "post_configProfileSwitch"):
132149
config.post_configProfileSwitch.notify()
133150
else: config.configProfileSwitched.notify()
@@ -147,13 +164,11 @@ def __init__(self):
147164
def event_typedCharacter(self, obj, nextHandler, ch):
148165
nextHandler()
149166
if config.conf['beepKeyboard']['beepUpperWithCapsLock'] and winUser.getKeyState(winUser.VK_CAPITAL)&1 and ch.isupper():
150-
tones.beep(config.conf['beepKeyboard']['capsLockUpperPitch'], 40)
167+
beep(config.conf['beepKeyboard']['capsLockUpperTone'])
151168
elif config.conf['beepKeyboard']['beepCharacterWithShift'] and not winUser.getKeyState(winUser.VK_CONTROL) &32768 and winUser.getKeyState(winUser.VK_SHIFT) &32768 and ch not in self.ignoredCharactersForShift and not (config.conf["keyboard"]["beepForLowercaseWithCapslock"] and ch.islower() and winUser.getKeyState(winUser.VK_CAPITAL)&1):
152-
v = config.conf['beepKeyboard']['shiftedCharactersVolume']
153-
tones.beep(config.conf['beepKeyboard']['shiftedCharactersPitch'], config.conf['beepKeyboard']['shiftedCharactersLength'], v, v)
169+
beep(config.conf['beepKeyboard']['shiftedCharactersTone'])
154170
elif ch in self.beepForCharacters:
155-
v = config.conf['beepKeyboard']['customCharactersVolume']
156-
tones.beep(config.conf['beepKeyboard']['customCharactersPitch'], config.conf['beepKeyboard']['customCharactersLength'], v, v)
171+
beep(config.conf['beepKeyboard']['customCharactersTone'])
157172

158173
def setExternalReportToggleStatus(self, flag):
159174
if flag:

addon/locale/es/LC_MESSAGES/nvda.po

Lines changed: 81 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -7,48 +7,118 @@ msgid ""
77
msgstr ""
88
"Project-Id-Version: 'beepKeyboard' '0.1b1'\n"
99
"Report-Msgid-Bugs-To: '[email protected]'\n"
10-
"POT-Creation-Date: 2019-04-12 20:20-0600\n"
11-
"PO-Revision-Date: 2019-04-12 20:50-0600\n"
10+
"POT-Creation-Date: 2019-04-14 22:07-0600\n"
11+
"PO-Revision-Date: 2019-04-14 22:31-0600\n"
12+
"Last-Translator: David CM <[email protected]>\n"
1213
"Language-Team: \n"
14+
"Language: es\n"
1315
"MIME-Version: 1.0\n"
1416
"Content-Type: text/plain; charset=UTF-8\n"
1517
"Content-Transfer-Encoding: 8bit\n"
1618
"X-Generator: Poedit 2.2.1\n"
17-
"Last-Translator: David CM <[email protected]>\n"
1819
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
19-
"Language: es\n"
2020

2121
#. Translators: This is the label for the beepKeyboard settings category in NVDA Settings screen.
2222
#. Add-on summary, usually the user visible name of the addon.
2323
#. Translators: Summary for this add-on to be shown on installation and add-on information.
24-
#: addon\globalPlugins\beepKeyboard.py:31 buildVars.py:17
24+
#: addon\globalPlugins\beepKeyboard.py:41 buildVars.py:17
2525
msgid "Beep keyboard"
2626
msgstr ""
2727

2828
#. Translators: label for a checkbox option in the settings panel.
29-
#: addon\globalPlugins\beepKeyboard.py:36
29+
#: addon\globalPlugins\beepKeyboard.py:46
3030
msgid "Beep for uppercases when &caps lock is on"
3131
msgstr "Pitar para &mayúsculas cuando el bloqueo mayúsculas está activado"
3232

3333
#. Translators: label for a checkbox option in the settings panel.
34-
#: addon\globalPlugins\beepKeyboard.py:39
34+
#: addon\globalPlugins\beepKeyboard.py:49
3535
msgid "Beep for typed characters when &shift is pressed"
3636
msgstr "Pitar para caracteres escritos cuando la tecla &shift es presionada"
3737

3838
#. Translators: label for a checkbox option in the settings panel.
39-
#: addon\globalPlugins\beepKeyboard.py:42
39+
#: addon\globalPlugins\beepKeyboard.py:52
4040
msgid "Beep for &toggle keys changes"
4141
msgstr "Pitar cuando cambia el estado de las &teclas interruptores."
4242

4343
#. Translators: label for a checkbox option in the settings panel.
44-
#: addon\globalPlugins\beepKeyboard.py:45
44+
#: addon\globalPlugins\beepKeyboard.py:55
4545
msgid ""
4646
"&Announce toggle keys changes (if Beep for toggle keys changes is disabled "
4747
"NVDA will have the original behavior)"
4848
msgstr ""
4949
"&Anunciar el cambio de estado de las teclas interruptores. (si \"Pitar "
50-
"cuando cambia el estado de las teclas interruptores\" está desactivado, "
51-
"NVDA tendrá el comportamiento original)"
50+
"cuando cambia el estado de las teclas interruptores\" está desactivado, NVDA "
51+
"tendrá el comportamiento original)"
52+
53+
#. Translators: label for a button to open advanced settings dialog in the settings panel.
54+
#: addon\globalPlugins\beepKeyboard.py:59
55+
msgid "&Open advanced options"
56+
msgstr "Abrir &opciones avanzadas"
57+
58+
#. Translators: This is the label for the beep keyboard advanced settings dialog
59+
#: addon\globalPlugins\beepKeyboard.py:78
60+
msgid "Advanced settings - Keyboard beep"
61+
msgstr "Opciones avanzadas - Keyboard beep"
62+
63+
#. Translators: label for an edit text control option in the advanced settings dialog.
64+
#: addon\globalPlugins\beepKeyboard.py:84
65+
msgid "&Ignored characters with shift pressed"
66+
msgstr "&ignorar caracteres escritos con la tecla shift presionada"
67+
68+
#. Translators: label for an edit text control option in the advanced settings dialog.
69+
#: addon\globalPlugins\beepKeyboard.py:87
70+
msgid "Beep &always for the following characters"
71+
msgstr "Pitar &siempre para los siguientes caracteres"
72+
73+
#. Translators: label for a combo box control in the advanced settings dialog.
74+
#: addon\globalPlugins\beepKeyboard.py:92
75+
msgid "&Select tone to configure"
76+
msgstr "Seleccionar un tono para su &configuración"
77+
78+
#. Translators: label for an option of a combo box control.
79+
#: addon\globalPlugins\beepKeyboard.py:94
80+
msgid "Typed characters with shift pressed"
81+
msgstr "caracteres escritos con la tecla shift presionada"
82+
83+
#. Translators: label for an option of a combo box control.
84+
#: addon\globalPlugins\beepKeyboard.py:96
85+
msgid "Custom characters"
86+
msgstr "Caracteres personalizados"
87+
88+
#. Translators: label for an option of a combo box control.
89+
#: addon\globalPlugins\beepKeyboard.py:98
90+
msgid "Typed characters when caps lock is on"
91+
msgstr "Caracteres escritos cuando el bloqueo mayúsculas está activado"
92+
93+
#. Translators: label for an option of a combo box control.
94+
#: addon\globalPlugins\beepKeyboard.py:100
95+
msgid "Toggle key goes off"
96+
msgstr "Se desactiva una tecla interruptor"
97+
98+
#. Translators: label for an option of a combo box control.
99+
#: addon\globalPlugins\beepKeyboard.py:102
100+
msgid "Toggle key goes on"
101+
msgstr "Se activa una tecla interruptor"
102+
103+
#. Translators: label for an edit text control option in the advanced settings dialog.
104+
#: addon\globalPlugins\beepKeyboard.py:107
105+
msgid "Tone &pitch"
106+
msgstr "&Tono"
107+
108+
#. Translators: label for an edit text control option in the advanced settings dialog.
109+
#: addon\globalPlugins\beepKeyboard.py:110
110+
msgid "Tone &length"
111+
msgstr "&Duración"
112+
113+
#. Translators: label for an edit text control option in the advanced settings dialog.
114+
#: addon\globalPlugins\beepKeyboard.py:113
115+
msgid "Tone &volume"
116+
msgstr "&Volumen"
117+
118+
#. Translators: label for a button to play demo tone in advanced settings dialog.
119+
#: addon\globalPlugins\beepKeyboard.py:116
120+
msgid "&Test tone"
121+
msgstr "&Probar el tono"
52122

53123
#. Add-on description
54124
#. Translators: Long description to be shown for this add-on on add-on information from add-ons manager

0 commit comments

Comments
 (0)