Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Report more object properties on mouse enter #15518

Merged
merged 5 commits into from
Sep 28, 2023
Merged
Show file tree
Hide file tree
Changes from 2 commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions source/NVDAObjects/__init__.py
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
# -*- coding: UTF-8 -*-
# A part of NonVisual Desktop Access (NVDA)
# Copyright (C) 2006-2023 NV Access Limited, Peter Vágner, Aleksey Sadovoy, Patrick Zajda, Babbage B.V.,
# Davy Kager
# Davy Kager, Leonard de Ruijter
# This file is covered by the GNU General Public License.
# See the file COPYING for more details.

Expand Down Expand Up @@ -1204,7 +1204,7 @@ def event_mouseMove(self, x: int, y: int) -> None:

if not self._mouseEntered and config.conf['mouse']['reportObjectRoleOnMouseEnter']:
speech.cancelSpeech()
speech.speakObjectProperties(self,role=True)
speech.speakObject(self, reason=controlTypes.OutputReason.MOUSE)
speechWasCanceled=True
else:
speechWasCanceled=False
Expand Down
16 changes: 10 additions & 6 deletions source/gui/settingsDialogs.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
# -*- coding: UTF-8 -*-
# A part of NonVisual Desktop Access (NVDA)
# Copyright (C) 2006-2023 NV Access Limited, Peter Vágner, Aleksey Sadovoy,
# Rui Batista, Joseph Lee, Heiko Folkerts, Zahari Yurukov, Leonard de Ruijter,
Expand Down Expand Up @@ -1832,10 +1831,12 @@ def makeSettings(self, settingsSizer):

# Translators: This is the label for a checkbox in the
# mouse settings panel.
reportObjectRoleText = _("Report &role when mouse enters object")
self.reportObjectRoleCheckBox=sHelper.addItem(wx.CheckBox(self,label=reportObjectRoleText))
self.bindHelpEvent("MouseSettingsRole", self.reportObjectRoleCheckBox)
LeonarddeR marked this conversation as resolved.
Show resolved Hide resolved
self.reportObjectRoleCheckBox.SetValue(config.conf["mouse"]["reportObjectRoleOnMouseEnter"])
reportObjectPropertiesText = _("Report &object when mouse enters it")
self.reportObjectPropertiesCheckBox = sHelper.addItem(
wx.CheckBox(self, label=reportObjectPropertiesText)
)
self.bindHelpEvent("MouseSettingsReportObjectPropertiesCheckBox", self.reportObjectPropertiesCheckBox)
self.reportObjectPropertiesCheckBox.SetValue(config.conf["mouse"]["reportObjectRoleOnMouseEnter"])

# Translators: This is the label for a checkbox in the
# mouse settings panel.
Expand All @@ -1862,11 +1863,14 @@ def onSave(self):
config.conf["mouse"]["reportMouseShapeChanges"]=self.shapeCheckBox.IsChecked()
config.conf["mouse"]["enableMouseTracking"]=self.mouseTrackingCheckBox.IsChecked()
config.conf["mouse"]["mouseTextUnit"]=self.textUnits[self.textUnitComboBox.GetSelection()]
config.conf["mouse"]["reportObjectRoleOnMouseEnter"]=self.reportObjectRoleCheckBox.IsChecked()
config.conf["mouse"]["reportObjectRoleOnMouseEnter"] = (
self.reportObjectPropertiesCheckBox.IsChecked()
)
config.conf["mouse"]["audioCoordinatesOnMouseMove"]=self.audioCheckBox.IsChecked()
config.conf["mouse"]["audioCoordinates_detectBrightness"]=self.audioDetectBrightnessCheckBox.IsChecked()
config.conf["mouse"]["ignoreInjectedMouseInput"]=self.ignoreInjectedMouseInputCheckBox.IsChecked()


class ReviewCursorPanel(SettingsPanel):
# Translators: This is the label for the review cursor settings panel.
title = _("Review Cursor")
Expand Down
12 changes: 9 additions & 3 deletions source/speech/speech.py
Original file line number Diff line number Diff line change
Expand Up @@ -643,8 +643,8 @@ def getObjectSpeech(
# Choose when we should report the content of this object's textInfo, rather than just the object's value
import browseMode
shouldReportTextContent=not (
# focusEntered should never present text content
(reason == OutputReason.FOCUSENTERED)
# focusEntered or mouse should never present text content
reason in (OutputReason.FOCUSENTERED, OutputReason.MOUSE)
# The rootNVDAObject of a browseMode document in browse mode (not passThrough)
# should never present text content
or (
Expand Down Expand Up @@ -729,10 +729,16 @@ def _objectSpeech_calculateAllowedProps(reason, shouldReportTextContent):
"columnSpan": True,
"current": True
}
if reason == OutputReason.FOCUSENTERED:
if reason in (OutputReason.FOCUSENTERED, OutputReason.MOUSE):
allowProperties["value"] = False
allowProperties["keyboardShortcut"] = False
allowProperties["positionInfo_level"] = False
if reason == OutputReason.MOUSE:
# Name is often part of the text content when mouse tracking.
allowProperties["name"] = False
allowProperties["description"] = False
allowProperties["positionInfo_indexInGroup"] = False
allowProperties["positionInfo_similarItemsInGroup"] = False
if not config.conf["presentation"]["reportObjectDescriptions"]:
allowProperties["description"] = False
if not config.conf["presentation"]["reportKeyboardShortcuts"]:
Expand Down
2 changes: 2 additions & 0 deletions user_docs/en/changes.t2t
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,8 @@ What's New in NVDA


== Changes ==
- The option "Report role when mouse enters object" in NVDA's mouse settings category has been renamed to "Report object when mouse enters it". This option now announces additional relevant information about an object when the mouse enters it, such as states (checked/pressed) or cell coordiantes in table. (#15420)
LeonarddeR marked this conversation as resolved.
Show resolved Hide resolved
-


== Bug Fixes ==
Expand Down
6 changes: 4 additions & 2 deletions user_docs/en/userGuide.t2t
Original file line number Diff line number Diff line change
Expand Up @@ -1957,8 +1957,10 @@ The options are character, word, line and paragraph.

To toggle text unit resolution from anywhere, please assign a custom gesture using the [Input Gestures dialog #InputGestures].

==== Report role when mouse enters object ====[MouseSettingsRole]
LeonarddeR marked this conversation as resolved.
Show resolved Hide resolved
If this checkbox is checked, NVDA will announce the role (type) of object as the mouse moves inside it.
==== Report object when mouse enters it ====[MouseSettingsReportObjectPropertiesCheckBox]
If this checkbox is checked, NVDA will announce information about objects as the mouse moves inside them.
This includes the role (type) of the object as well as states (checked/pressed), cell coordinates in tables, etc.
Note that the announcement of some object dedtails might be dependent on how other settings, such as in the [object presentation #ObjectPresentationSettings] or [Document Formatting #DocumentFormattingSettings] categories are set.
LeonarddeR marked this conversation as resolved.
Show resolved Hide resolved

==== Play audio coordinates when mouse moves ====[MouseSettingsAudio]
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.
Expand Down