Skip to content

Commit b3fe579

Browse files
authored
Add script to toggle mouse audio coordinates (#19026) (#19282)
Fixes #19026 Summary of the issue: This PR adds a new global script script_toggleMouseAudioCoordinates in globalCommands.py. The script: Appears in the Mouse category of the Input Gestures dialog. Toggles the existing mouse/audioCoordinatesOnMouseMove configuration value using toggleBooleanValue. Announces “Mouse audio coordinates on/off” when toggled. No default gesture is assigned in code. Users can bind any gesture they like from NVDA menu → Preferences → Input gestures… → Mouse. Description of user facing changes: Adds a new script in the Mouse category of the Input Gestures dialog that allows users to assign a gesture to toggle mouse audio coordinates (beeps that report mouse location). There is no behavior change unless a user assigns a gesture. Description of developer facing changes: -Adds script_toggleMouseAudioCoordinates to GlobalCommands in globalCommands.py. Uses the existing toggleBooleanValue helper to toggle config.conf["mouse"]["audioCoordinatesOnMouseMove"]. No changes to public APIs or configuration schema. Description of development approach: Reuse the existing toggleBooleanValue helper to avoid duplicating toggle logic and messages. Only globalCommands.py is updated; no new settings or gesture defaults are added. Testing strategy: Ran NVDA from source using runnvda.bat. Opened Preferences → Input gestures… → Mouse. Confirmed that a new script “Toggles beeps that report mouse coordinates as the mouse moves” is present. Assigned a temporary gesture (e.g. NVDA+Shift+M) and verified that: The gesture toggles the “Play audio coordinates when mouse moves” option. NVDA reports “Mouse audio coordinates on/off”.
1 parent e29ed1d commit b3fe579

File tree

3 files changed

+20
-0
lines changed

3 files changed

+20
-0
lines changed

source/globalCommands.py

Lines changed: 17 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3042,6 +3042,23 @@ def script_toggleMouseTracking(self, gesture):
30423042
config.conf["mouse"]["enableMouseTracking"] = True
30433043
ui.message(state)
30443044

3045+
@script(
3046+
# Translators: Input help mode message for toggle mouse audio coordinates command.
3047+
description=_("Toggles beeps that report mouse coordinates as the mouse moves"),
3048+
category=SCRCAT_MOUSE,
3049+
)
3050+
def script_toggleMouseAudioCoordinates(self, gesture: inputCore.InputGetsture):
3051+
# Translators: Reported when mouse audio coordinates are toggled on.
3052+
enabledMsg = _("Mouse audio coordinates on")
3053+
# Translators: Reported when mouse audio coordinates are toggled off.
3054+
disabledMsg = _("Mouse audio coordinates off")
3055+
toggleBooleanValue(
3056+
configSection="mouse",
3057+
configKey="audioCoordinatesOnMouseMove",
3058+
enabledMsg=enabledMsg,
3059+
disabledMsg=disabledMsg,
3060+
)
3061+
30453062
@script(
30463063
# Translators: Input help mode message for toggle mouse text unit resolution command.
30473064
description=_("Toggles how much text will be spoken when the mouse moves"),

user_docs/en/changes.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -333,6 +333,7 @@ Localisation data for emojis has been added for Belarusian and Bosnian.
333333
* Installation date will now be also shown in the details area for external add-ons. (#18560, @CyrilleB79)
334334
* A new unassigned command has been added to send `control+alt+delete` when controlling another computer via NVDA Remote Access. (#18105)
335335
* A new setting has been added to automatically mute Remote Access when controlling the local computer. (#18630)
336+
* A new unassigned global command has been added to toggle the "Play audio coordinates when mouse moves" option. (#19026, @rlawnsrl123)
336337

337338
### Changes
338339

user_docs/en/userGuide.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -952,6 +952,7 @@ Although a physical mouse or trackpad should be used to navigate with the mouse,
952952
|Scroll right at the mouse position |none |none |none |Scrolls the mouse wheel right at the current mouse position|
953953
|Move mouse to current navigator object |NVDA+numpadDivide |NVDA+shift+m |none |Moves the mouse to the location of the current navigator object and review cursor|
954954
|Navigate to the object under the mouse |NVDA+numpadMultiply |NVDA+shift+n |none |Set the navigator object to the object located at the position of the mouse|
955+
|Toggle mouse audio coordinates |none |none |none |Toggles whether NVDA plays audio beeps that report the mouse position as it moves.|
955956

956957
<!-- KC:endInclude -->
957958

@@ -2811,6 +2812,7 @@ Note that the announcement of some object details might be dependent on how othe
28112812
Checking this checkbox makes NVDA play beeps as the mouse moves, so that the user can work out where the mouse is in regards to the dimensions of the screen.
28122813
The higher the mouse is on the screen, the higher the pitch of the beeps.
28132814
The further left or right the mouse is located on the screen, the further left or right the sound will be played (assuming the user has stereo speakers or headphones).
2815+
You can also assign a custom gesture in the Mouse category of the Input Gestures dialog to toggle this option.
28142816

28152817
##### Brightness controls audio coordinates volume {#MouseSettingsBrightness}
28162818

0 commit comments

Comments
 (0)