diff --git a/projectDocs/dev/developerGuide/developerGuide.md b/projectDocs/dev/developerGuide/developerGuide.md index 3559a0932c..b471171e2d 100644 --- a/projectDocs/dev/developerGuide/developerGuide.md +++ b/projectDocs/dev/developerGuide/developerGuide.md @@ -1383,7 +1383,7 @@ For examples of how to define and use new extension points, please see the code |`Action` |`speechCanceled` |Triggered when speech is canceled.| |`Action` |`pre_speechCanceled` |Triggered before speech is canceled.| |`Action` |`pre_speech` |Triggered before NVDA handles prepared speech.| -|`Action` |`speechPaused` |Triggered when speech is paused or resumed.| +|`Action` |`post_speechPaused` |Triggered when speech is paused or resumed.| |`Filter` |`filter_speechSequence` |Allows components or add-ons to filter speech sequence before it passes to the synth driver.| ### synthDriverHandler {#synthDriverHandlerExtPts} diff --git a/source/inputCore.py b/source/inputCore.py index cf11d6efb4..413ba2ae9a 100644 --- a/source/inputCore.py +++ b/source/inputCore.py @@ -457,10 +457,15 @@ def __eq__(self, other: Any) -> bool: Notifies when a raw keyboard event is received, before any NVDA processing. Handlers can decide whether the key should be processed by NVDA and/or passed to the OS. @param vkCode: The virtual key code +@type vkCode: int @param scanCode: The scan code +@type scanCode: int @param extended: Whether this is an extended key +@type extended: bool @param pressed: Whether this is a key press or release +@type pressed: bool @return: True to allow normal processing, False to block the key +@rtype: bool """ decide_executeGesture = extensionPoints.Decider() diff --git a/source/speech/__init__.py b/source/speech/__init__.py index 5e31b01b00..7090bd8ab5 100644 --- a/source/speech/__init__.py +++ b/source/speech/__init__.py @@ -63,7 +63,7 @@ spellTextInfo, splitTextIndentation, ) -from .extensions import speechCanceled, speechPaused +from .extensions import speechCanceled, post_speechPaused from .priorities import Spri from .types import ( @@ -142,7 +142,7 @@ "spellTextInfo", "splitTextIndentation", "speechCanceled", - "speechPaused", + "post_speechPaused", ] import synthDriverHandler diff --git a/source/speech/extensions.py b/source/speech/extensions.py index 049c5118c6..f8dd885ba4 100644 --- a/source/speech/extensions.py +++ b/source/speech/extensions.py @@ -22,7 +22,7 @@ Handlers are called without arguments. """ -speechPaused = Action() +post_speechPaused = Action() """ Notifies when speech is paused. diff --git a/source/speech/speech.py b/source/speech/speech.py index 3153208b8d..49992c0b03 100644 --- a/source/speech/speech.py +++ b/source/speech/speech.py @@ -27,7 +27,7 @@ from textUtils import unicodeNormalize from textUtils.uniscribe import splitAtCharacterBoundaries from . import manager -from .extensions import speechCanceled, speechPaused, pre_speechCanceled, pre_speech +from .extensions import speechCanceled, post_speechPaused, pre_speechCanceled, pre_speech from .extensions import filter_speechSequence from .commands import ( # Commands that are used in this file. @@ -211,7 +211,7 @@ def cancelSpeech(): def pauseSpeech(switch): getSynth().pause(switch) - speechPaused.notify(switch=switch) + post_speechPaused.notify(switch=switch) _speechState.isPaused = switch _speechState.beenCanceled = False diff --git a/tests/unit/test_speech.py b/tests/unit/test_speech.py index fb0b60eaea..a50557f1c4 100644 --- a/tests/unit/test_speech.py +++ b/tests/unit/test_speech.py @@ -18,7 +18,7 @@ cancelSpeech, pauseSpeech, speechCanceled, - speechPaused, + post_speechPaused, ) from speech.commands import ( BeepCommand, @@ -594,9 +594,9 @@ def test_speechCanceledExtensionPoint(self): ): cancelSpeech() - def test_speechPausedExtensionPoint(self): - with actionTester(self, speechPaused, switch=True): + def test_post_speechPausedExtensionPoint(self): + with actionTester(self, post_speechPaused, switch=True): pauseSpeech(True) - with actionTester(self, speechPaused, switch=False): + with actionTester(self, post_speechPaused, switch=False): pauseSpeech(False) diff --git a/user_docs/en/changes.md b/user_docs/en/changes.md index b40e644afe..7bcd06c68c 100644 --- a/user_docs/en/changes.md +++ b/user_docs/en/changes.md @@ -99,9 +99,9 @@ Add-ons will need to be re-tested and have their manifest updated. * Removed the requirement to indent function parameter lists by two tabs from NVDA's Coding Standards, to be compatible with modern automatic linting. (#17126, @XLTechie) * Added the [VS Code workspace configuration for NVDA](https://nvaccess.org/nvaccess/vscode-nvda) as a git submodule. (#17003) * In the `brailleTables` module, a `getDefaultTableForCurrentLang` function has been added (#17222, @nvdaes) -* Added the following extension points: - * inputCore.decide_handleRawKey: called on each keypress - * speech.extensions.speechPaused: Called when speech is paused or unpaused +* Added the following extension points (#17428): + * `inputCore.decide_handleRawKey`: called on each keypress + * `speech.extensions.post_speechPaused`: Called when speech is paused or unpaused #### API Breaking Changes