Skip to content

Commit 8c8feb8

Browse files
committed
beep keyboard first beta release.
1 parent 6b0c62e commit 8c8feb8

File tree

14 files changed

+906
-0
lines changed

14 files changed

+906
-0
lines changed

.gitattributes

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,8 @@
1+
# Set default behaviour, in case users don't have core.autocrlf set.
2+
* text=auto
3+
4+
# Try to ensure that po files in the repo does not include
5+
# source code line numbers.
6+
# Every person expected to commit po files should change their personal config file as described here:
7+
# https://mail.gnome.org/archives/kupfer-list/2010-June/msg00002.html
8+
*.po filter=cleanpo

.gitignore

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,9 @@
1+
addon/doc/*.css
2+
addon/doc/en/
3+
*_docHandler.py
4+
*.html
5+
*.ini
6+
*.mo
7+
*.py[co]
8+
*.nvda-addon
9+
.sconsign.dblite

COPYING.txt

Lines changed: 340 additions & 0 deletions
Large diffs are not rendered by default.

addon/doc/es/readme.md

Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
# Beep keyboard NVDA Add-on #
2+
Este complemento permite al usuario configurar a NVDA para pitar con algunos eventos de teclado.
3+
4+
Copyright (C) 2019 David CM <[email protected]>
5+
Este paquete es distribuido bajo los términos de la GNU General Public License, versión 2 o posterior.
6+
7+
## Características
8+
9+
Este complemento provee las siguientes características que puedes usar para adaptar el comportamiento de teclado de NVDA:
10+
* Pitar para mayúsculas cuando el bloqueo mayúsculas está activado: si esta característica está habilitada, NVDA pitará cuando escribas una letra mayúscula y el bloqueo mayúsculas esté activo. ¡No cometa más errores de mayúsculas!
11+
* 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.
12+
* 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.
13+
* 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.
14+
15+
## Requisitos
16+
usted necesita NVDA 2018.2 o posterior.
Lines changed: 79 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,79 @@
1+
# -*- coding: UTF-8 -*-
2+
# Beep keyboard: This add-on beeps with some keyboard events.
3+
# Copyright (C) 2019 David CM
4+
# Author: David CM <[email protected]>
5+
# Released under GPL 2
6+
#globalPlugins/capsLockBeeper.py
7+
8+
import config, globalPluginHandler, gui, keyboardHandler, tones, winUser, wx, addonHandler
9+
addonHandler.initTranslation()
10+
11+
confspec = {
12+
"beepUpperWithCapsLock": "boolean(default=True)",
13+
"beepCharacterWithShift": "boolean(default=False)",
14+
"beepToggleKeyChanges": "boolean(default=False)",
15+
"announceToggleStatus": "boolean(default=True)"
16+
}
17+
config.conf.spec["beepKeyboard"] = confspec
18+
19+
#saves the original _reportToggleKey function
20+
origReportToggleKey = keyboardHandler.KeyboardInputGesture._reportToggleKey
21+
# alternate function to report state key.
22+
def _reportToggleKey(self):
23+
if winUser.getKeyState(self.vkCode) & 1:
24+
tones.beep(2000,40)
25+
else: tones.beep(1000,40)
26+
if config.conf['beepKeyboard']['announceToggleStatus']: origReportToggleKey(self)
27+
28+
29+
class BeepKeyboardSettingsPanel(gui.SettingsPanel):
30+
# Translators: This is the label for the beepKeyboard settings category in NVDA Settings screen.
31+
title = _("Beep keyboard")
32+
33+
def makeSettings(self, settingsSizer):
34+
sHelper = gui.guiHelper.BoxSizerHelper(self, sizer=settingsSizer)
35+
# Translators: label for a checkbox option in the settings panel.
36+
self.beepUpperWithCapsLock = sHelper.addItem(wx.CheckBox(self, label=_("Beep for uppercases when &caps lock is on")))
37+
self.beepUpperWithCapsLock.SetValue(config.conf['beepKeyboard']['beepUpperWithCapsLock'])
38+
# Translators: label for a checkbox option in the settings panel.
39+
self.beepCharacterWithShift = sHelper.addItem(wx.CheckBox(self, label=_("Beep for typed characters when &shift is pressed")))
40+
self.beepCharacterWithShift.SetValue(config.conf['beepKeyboard']['beepCharacterWithShift'])
41+
# Translators: label for a checkbox option in the settings panel.
42+
self.beepToggleKeyChanges = sHelper.addItem(wx.CheckBox(self, label=_("Beep for &toggle keys changes")))
43+
self.beepToggleKeyChanges.SetValue(config.conf['beepKeyboard']['beepToggleKeyChanges'])
44+
# Translators: label for a checkbox option in the settings panel.
45+
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)")))
46+
self.announceToggleStatus.SetValue(config.conf['beepKeyboard']['announceToggleStatus'])
47+
48+
def onSave(self):
49+
config.conf['beepKeyboard']['beepUpperWithCapsLock'] = self.beepUpperWithCapsLock.GetValue()
50+
config.conf['beepKeyboard']['beepCharacterWithShift'] = self.beepCharacterWithShift.GetValue()
51+
config.conf['beepKeyboard']['beepToggleKeyChanges'] = self.beepToggleKeyChanges.GetValue()
52+
config.conf['beepKeyboard']['announceToggleStatus'] = self.announceToggleStatus.GetValue()
53+
if hasattr(config, "post_configProfileSwitch"):
54+
config.post_configProfileSwitch.notify()
55+
else:
56+
config.configProfileSwitched.notify()
57+
58+
59+
60+
class GlobalPlugin(globalPluginHandler.GlobalPlugin):
61+
def __init__(self):
62+
super(globalPluginHandler.GlobalPlugin, self).__init__()
63+
gui.settingsDialogs.NVDASettingsDialog.categoryClasses.append(BeepKeyboardSettingsPanel)
64+
self.setExternalReportToggleStatus()
65+
if hasattr(config, "post_configProfileSwitch"):
66+
config.post_configProfileSwitch.register(self.setExternalReportToggleStatus)
67+
else:
68+
config.configProfileSwitched.register(self.setExternalReportToggleStatus)
69+
70+
def event_typedCharacter(self, obj, nextHandler, ch):
71+
nextHandler()
72+
if ((config.conf['beepKeyboard']['beepUpperWithCapsLock'] and winUser.getKeyState(winUser.VK_CAPITAL)&1 and ch.isupper())
73+
or (config.conf['beepKeyboard']['beepCharacterWithShift'] and (winUser.getKeyState(winUser.VK_LSHIFT) &32768 or winUser.getKeyState(winUser.VK_RSHIFT) &32768))):
74+
tones.beep(3000,40)
75+
76+
def setExternalReportToggleStatus(self):
77+
if config.conf['beepKeyboard']['beepToggleKeyChanges']:
78+
keyboardHandler.KeyboardInputGesture._reportToggleKey = _reportToggleKey
79+
else: keyboardHandler.KeyboardInputGesture._reportToggleKey = origReportToggleKey
Lines changed: 57 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,57 @@
1+
# SOME DESCRIPTIVE TITLE.
2+
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3+
# This file is distributed under the same license as the 'beepKeyboard' package.
4+
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5+
#
6+
msgid ""
7+
msgstr ""
8+
"Project-Id-Version: 'beepKeyboard' '0.1b1'\n"
9+
"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"
12+
"Language-Team: \n"
13+
"MIME-Version: 1.0\n"
14+
"Content-Type: text/plain; charset=UTF-8\n"
15+
"Content-Transfer-Encoding: 8bit\n"
16+
"X-Generator: Poedit 2.2.1\n"
17+
"Last-Translator: David CM <[email protected]>\n"
18+
"Plural-Forms: nplurals=2; plural=(n != 1);\n"
19+
"Language: es\n"
20+
21+
#. Translators: This is the label for the beepKeyboard settings category in NVDA Settings screen.
22+
#. Add-on summary, usually the user visible name of the addon.
23+
#. Translators: Summary for this add-on to be shown on installation and add-on information.
24+
#: addon\globalPlugins\beepKeyboard.py:31 buildVars.py:17
25+
msgid "Beep keyboard"
26+
msgstr ""
27+
28+
#. Translators: label for a checkbox option in the settings panel.
29+
#: addon\globalPlugins\beepKeyboard.py:36
30+
msgid "Beep for uppercases when &caps lock is on"
31+
msgstr "Pitar para &mayúsculas cuando el bloqueo mayúsculas está activado"
32+
33+
#. Translators: label for a checkbox option in the settings panel.
34+
#: addon\globalPlugins\beepKeyboard.py:39
35+
msgid "Beep for typed characters when &shift is pressed"
36+
msgstr "Pitar para caracteres escritos cuando la tecla &shift es presionada"
37+
38+
#. Translators: label for a checkbox option in the settings panel.
39+
#: addon\globalPlugins\beepKeyboard.py:42
40+
msgid "Beep for &toggle keys changes"
41+
msgstr "Pitar cuando cambia el estado de las &teclas interruptores."
42+
43+
#. Translators: label for a checkbox option in the settings panel.
44+
#: addon\globalPlugins\beepKeyboard.py:45
45+
msgid ""
46+
"&Announce toggle keys changes (if Beep for toggle keys changes is disabled "
47+
"NVDA will have the original behavior)"
48+
msgstr ""
49+
"&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)"
52+
53+
#. Add-on description
54+
#. Translators: Long description to be shown for this add-on on add-on information from add-ons manager
55+
#: buildVars.py:20
56+
msgid "This add-on beeps with some keyboard events."
57+
msgstr "Este complemento hace que NVDA pite con algunos eventos de teclado."

beepKeyboard.pot

Lines changed: 53 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,53 @@
1+
# SOME DESCRIPTIVE TITLE.
2+
# Copyright (C) YEAR THE PACKAGE'S COPYRIGHT HOLDER
3+
# This file is distributed under the same license as the 'beepKeyboard' package.
4+
# FIRST AUTHOR <EMAIL@ADDRESS>, YEAR.
5+
#
6+
#, fuzzy
7+
msgid ""
8+
msgstr ""
9+
"Project-Id-Version: 'beepKeyboard' '0.1b1'\n"
10+
"Report-Msgid-Bugs-To: '[email protected]'\n"
11+
"POT-Creation-Date: 2019-04-12 20:20-0600\n"
12+
"PO-Revision-Date: YEAR-MO-DA HO:MI+ZONE\n"
13+
"Last-Translator: FULL NAME <EMAIL@ADDRESS>\n"
14+
"Language-Team: LANGUAGE <[email protected]>\n"
15+
"Language: \n"
16+
"MIME-Version: 1.0\n"
17+
"Content-Type: text/plain; charset=CHARSET\n"
18+
"Content-Transfer-Encoding: 8bit\n"
19+
20+
#. Translators: This is the label for the beepKeyboard settings category in NVDA Settings screen.
21+
#. Add-on summary, usually the user visible name of the addon.
22+
#. Translators: Summary for this add-on to be shown on installation and add-on information.
23+
#: addon\globalPlugins\beepKeyboard.py:31 buildVars.py:17
24+
msgid "Beep keyboard"
25+
msgstr ""
26+
27+
#. Translators: label for a checkbox option in the settings panel.
28+
#: addon\globalPlugins\beepKeyboard.py:36
29+
msgid "Beep for uppercases when &caps lock is on"
30+
msgstr ""
31+
32+
#. Translators: label for a checkbox option in the settings panel.
33+
#: addon\globalPlugins\beepKeyboard.py:39
34+
msgid "Beep for typed characters when &shift is pressed"
35+
msgstr ""
36+
37+
#. Translators: label for a checkbox option in the settings panel.
38+
#: addon\globalPlugins\beepKeyboard.py:42
39+
msgid "Beep for &toggle keys changes"
40+
msgstr ""
41+
42+
#. Translators: label for a checkbox option in the settings panel.
43+
#: addon\globalPlugins\beepKeyboard.py:45
44+
msgid ""
45+
"&Announce toggle keys changes (if Beep for toggle keys changes is disabled "
46+
"NVDA will have the original behavior)"
47+
msgstr ""
48+
49+
#. Add-on description
50+
#. Translators: Long description to be shown for this add-on on add-on information from add-ons manager
51+
#: buildVars.py:20
52+
msgid "This add-on beeps with some keyboard events."
53+
msgstr ""

buildVars.py

Lines changed: 48 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,48 @@
1+
# -*- coding: UTF-8 -*-
2+
3+
# Build customizations
4+
# Change this file instead of sconstruct or manifest files, whenever possible.
5+
6+
# Full getext (please don't change)
7+
_ = lambda x : x
8+
9+
# Add-on information variables
10+
addon_info = {
11+
# for previously unpublished addons, please follow the community guidelines at:
12+
# https://bitbucket.org/nvdaaddonteam/todo/raw/master/guideLines.txt
13+
# add-on Name, internal for nvda
14+
"addon_name" : "beepKeyboard",
15+
# Add-on summary, usually the user visible name of the addon.
16+
# Translators: Summary for this add-on to be shown on installation and add-on information.
17+
"addon_summary" : _("Beep keyboard"),
18+
# Add-on description
19+
# Translators: Long description to be shown for this add-on on add-on information from add-ons manager
20+
"addon_description" : _("""This add-on beeps with some keyboard events."""),
21+
# version
22+
"addon_version" : "0.1b1",
23+
# Author(s)
24+
"addon_author" : u"David CM <[email protected]>",
25+
# URL for the add-on documentation support
26+
"addon_url" : "https://github.com/david-acm/NVDA-beepKeyboard",
27+
# Documentation file name
28+
"addon_docFileName" : "readme.html",
29+
# Minimum NVDA version supported (e.g. "2018.3.0")
30+
"addon_minimumNVDAVersion" : "2018.2.0",
31+
# Last NVDA version supported/tested (e.g. "2018.4.0", ideally more recent than minimum version)
32+
"addon_lastTestedNVDAVersion" : "2019.1.0",
33+
# Add-on update channel (default is stable or None)
34+
"addon_updateChannel" : None,
35+
}
36+
37+
from os import path
38+
39+
# Define the python files that are the sources of your add-on.
40+
# You can use glob expressions here, they will be expanded.
41+
pythonSources = [path.join("addon", "globalPlugins", "beepKeyboard.py")]
42+
43+
# Files that contain strings for translation. Usually your python sources
44+
i18nSources = pythonSources + ["buildVars.py"]
45+
46+
# Files that will be ignored when building the nvda-addon file
47+
# Paths are relative to the addon directory, not to the root directory of your addon sources.
48+
excludedFiles = []

manifest-translated.ini.tpl

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
summary = "{addon_summary}"
2+
description = """{addon_description}"""

manifest.ini.tpl

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
name = {addon_name}
2+
summary = "{addon_summary}"
3+
description = """{addon_description}"""
4+
author = "{addon_author}"
5+
url = {addon_url}
6+
version = {addon_version}
7+
docFileName = {addon_docFileName}
8+
minimumNVDAVersion = {addon_minimumNVDAVersion}
9+
lastTestedNVDAVersion = {addon_lastTestedNVDAVersion}
10+
updateChannel = {addon_updateChannel}

0 commit comments

Comments
 (0)