Skip to content

Commit da83845

Browse files
authored
add unassigned command to report the status of screen curtain (#19767)
Summary of the issue: users needs a way to know what the current status of screen curtain is . Previously , Users had to check the NVDA settings or perform the shortcut NVDA+CTRL+ESC to know what is the current status of the screen curtain if it is activated or deactivated. Description of user facing changes: Now, users can assign a new custom shortcut that when it is performed will allow the users to get a notification with the current status of the screen curtain . Description of developer facing changes: None Description of development approach: Added a new intrys with an if check in /source/globalCommands.py, and added new entrys in the changes and the user docs files
1 parent 9a320db commit da83845

File tree

3 files changed

+32
-0
lines changed

3 files changed

+32
-0
lines changed

source/globalCommands.py

Lines changed: 30 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4967,6 +4967,36 @@ def _enableScreenCurtain(doEnable: bool = True):
49674967
return
49684968
_enableScreenCurtain()
49694969

4970+
@script(
4971+
description=_(
4972+
# Translators: Describes a command.
4973+
"Reports the state of the screen curtain.",
4974+
),
4975+
category=SCRCAT_VISION,
4976+
)
4977+
def script_reportScreenCurtainState(self, gesture: inputCore.InputGesture) -> None:
4978+
import screenCurtain
4979+
4980+
if screenCurtain.screenCurtain is None:
4981+
# Screen curtain has not been initialized.
4982+
# Translators: Reported when the screen curtain is not available.
4983+
ui.message(_("Screen curtain not available"), speechPriority=speech.priorities.Spri.NOW)
4984+
return
4985+
4986+
if screenCurtain.screenCurtain.enabled:
4987+
if not screenCurtain.screenCurtain.settings["enabled"]:
4988+
# Translators: Reported when the screen curtain is temporarily enabled.
4989+
ui.message(
4990+
_("Temporary Screen curtain, enabled until next restart"),
4991+
speechPriority=speech.priorities.Spri.NOW,
4992+
)
4993+
else:
4994+
# Translators: Reported when the screen curtain is enabled.
4995+
ui.message(_("Screen curtain enabled"), speechPriority=speech.priorities.Spri.NOW)
4996+
else:
4997+
# Translators: Reported when the screen curtain is disabled.
4998+
ui.message(_("Screen curtain disabled"), speechPriority=speech.priorities.Spri.NOW)
4999+
49705000
@script(
49715001
description=_(
49725002
# Translators: Describes a command.

user_docs/en/changes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,7 @@
2424
Consult the speech dictionaries section in the User Guide for more details. (#19506, @LeonarddeR)
2525
* When resetting the configuration to factory defaults from the NVDA menu, a dialog is now shown afterwards with an Undo button to restore the previous configuration.
2626
The triple-press keyboard shortcut (`NVDA+ctrl+r`) is not affected, as it is intended for recovery scenarios. (#19575, @bramd)
27+
* Added an unassigned command to report the current status of the Screen Curtain. (#19759)
2728

2829
### Changes
2930

user_docs/en/userGuide.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1511,6 +1511,7 @@ You can enable Screen Curtain in the [Privacy and Security category](#PrivacyAnd
15111511
| Name |Key |Description|
15121512
|---|---|---|
15131513
|Toggles the state of the screen curtain |`NVDA+control+escape` |Enable to make the screen black or disable to show the contents of the screen. Pressed once, screen curtain is enabled until you restart NVDA. Pressed twice, screen curtain is enabled until you disable it.|
1514+
| Reports the state of the screen curtain | `None` | Announces the current status of the screen curtain, whether it is disabled or enabled or in temporary mode. |
15141515

15151516
<!-- KC:endInclude -->
15161517

0 commit comments

Comments
 (0)