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

Disable "automatically set focus to focusable elements" by default #11190

Merged
merged 6 commits into from
Jun 25, 2020
Merged
Show file tree
Hide file tree
Changes from 3 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
10 changes: 5 additions & 5 deletions source/config/configSpec.py
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
# -*- coding: UTF-8 -*-
#A part of NonVisual Desktop Access (NVDA)
#Copyright (C) 2006-2019 NV Access Limited, Babbage B.V., Davy Kager, Bill Dengler
#This file is covered by the GNU General Public License.
#See the file COPYING for more details.
# A part of NonVisual Desktop Access (NVDA)
# Copyright (C) 2006-2020 NV Access Limited, Babbage B.V., Davy Kager, Bill Dengler
# This file is covered by the GNU General Public License.
# See the file COPYING for more details.

from io import StringIO
from configobj import ConfigObj
Expand Down Expand Up @@ -158,7 +158,7 @@
autoSayAllOnPageLoad = boolean(default=true)
trapNonCommandGestures = boolean(default=true)
enableOnPageLoad = boolean(default=true)
autoFocusFocusableElements = boolean(default=True)
autoFocusFocusableElements = boolean(default=False)

[touch]
touchTyping = boolean(default=False)
Expand Down
36 changes: 14 additions & 22 deletions source/gui/settingsDialogs.py
Original file line number Diff line number Diff line change
Expand Up @@ -1913,6 +1913,16 @@ def makeSettings(self, settingsSizer):
self.trapNonCommandGesturesCheckBox = sHelper.addItem(wx.CheckBox(self, label=trapNonCommandGesturesText))
self.trapNonCommandGesturesCheckBox.SetValue(config.conf["virtualBuffers"]["trapNonCommandGestures"])

# Translators: This is the label for a checkbox in the
# browse mode settings panel.
autoFocusFocusableElementsText = _("Automatically set system &focus to focusable elements")
self.autoFocusFocusableElementsCheckBox = sHelper.addItem(
wx.CheckBox(self, wx.ID_ANY, label=autoFocusFocusableElementsText)
codeofdusk marked this conversation as resolved.
Show resolved Hide resolved
)
self.autoFocusFocusableElementsCheckBox.SetValue(
config.conf["virtualBuffers"]["autoFocusFocusableElements"]
)

def onSave(self):
config.conf["virtualBuffers"]["maxLineLength"]=self.maxLengthEdit.GetValue()
config.conf["virtualBuffers"]["linesPerPage"]=self.pageLinesEdit.GetValue()
Expand All @@ -1924,6 +1934,10 @@ def onSave(self):
config.conf["virtualBuffers"]["autoPassThroughOnCaretMove"]=self.autoPassThroughOnCaretMoveCheckBox.IsChecked()
config.conf["virtualBuffers"]["passThroughAudioIndication"]=self.passThroughAudioIndicationCheckBox.IsChecked()
config.conf["virtualBuffers"]["trapNonCommandGestures"]=self.trapNonCommandGesturesCheckBox.IsChecked()
config.conf["virtualBuffers"]["autoFocusFocusableElements"] = (
self.autoFocusFocusableElementsCheckBox.IsChecked()
)


class DocumentFormattingPanel(SettingsPanel):
# Translators: This is the label for the document formatting panel.
Expand Down Expand Up @@ -2374,22 +2388,6 @@ def __init__(self, parent):
["featureFlag", "cancelExpiredFocusSpeech"]
)

# Translators: This is the label for a group of advanced options in the
# Advanced settings panel
label = _("Browse mode")
browseModeGroup = guiHelper.BoxSizerHelper(
parent=self,
sizer=wx.StaticBoxSizer(parent=self, label=label, orient=wx.VERTICAL)
)
sHelper.addItem(browseModeGroup)

# Translators: This is the label for a checkbox in the
# Advanced settings panel.
autoFocusFocusableElementsText = _("Automatically set system &focus to focusable elements")
self.autoFocusFocusableElementsCheckBox=browseModeGroup.addItem(wx.CheckBox(self,wx.ID_ANY,label=autoFocusFocusableElementsText))
self.autoFocusFocusableElementsCheckBox.SetValue(config.conf["virtualBuffers"]["autoFocusFocusableElements"])
self.autoFocusFocusableElementsCheckBox.defaultValue=self._getDefaultValue(["virtualBuffers","autoFocusFocusableElements"])

# Translators: This is the label for a group of advanced options in the
# Advanced settings panel
label = _("Editable Text")
Expand Down Expand Up @@ -2466,10 +2464,6 @@ def haveConfigDefaultsBeenRestored(self):
and self.winConsoleSpeakPasswordsCheckBox.IsChecked() == self.winConsoleSpeakPasswordsCheckBox.defaultValue
and self.cancelExpiredFocusSpeechCombo.GetSelection() == self.cancelExpiredFocusSpeechCombo.defaultValue
and self.keyboardSupportInLegacyCheckBox.IsChecked() == self.keyboardSupportInLegacyCheckBox.defaultValue
and (
self.autoFocusFocusableElementsCheckBox.IsChecked()
== self.autoFocusFocusableElementsCheckBox.defaultValue
)
and self.caretMoveTimeoutSpinControl.GetValue() == self.caretMoveTimeoutSpinControl.defaultValue
and set(self.logCategoriesList.CheckedItems) == set(self.logCategoriesList.defaultCheckedItems)
and True # reduce noise in diff when the list is extended.
Expand All @@ -2482,7 +2476,6 @@ def restoreToDefaults(self):
self.winConsoleSpeakPasswordsCheckBox.SetValue(self.winConsoleSpeakPasswordsCheckBox.defaultValue)
self.cancelExpiredFocusSpeechCombo.SetValue(self.cancelExpiredFocusSpeechCombo.defaultValue)
self.keyboardSupportInLegacyCheckBox.SetValue(self.keyboardSupportInLegacyCheckBox.defaultValue)
self.autoFocusFocusableElementsCheckBox.SetValue(self.autoFocusFocusableElementsCheckBox.defaultValue)
self.caretMoveTimeoutSpinControl.SetValue(self.caretMoveTimeoutSpinControl.defaultValue)
self.logCategoriesList.CheckedItems = self.logCategoriesList.defaultCheckedItems
self._defaultsRestored = True
Expand All @@ -2498,7 +2491,6 @@ def onSave(self):
config.conf["terminals"]["speakPasswords"] = self.winConsoleSpeakPasswordsCheckBox.IsChecked()
config.conf["featureFlag"]["cancelExpiredFocusSpeech"] = self.cancelExpiredFocusSpeechCombo.GetSelection()
config.conf["terminals"]["keyboardSupportInLegacy"]=self.keyboardSupportInLegacyCheckBox.IsChecked()
config.conf["virtualBuffers"]["autoFocusFocusableElements"] = self.autoFocusFocusableElementsCheckBox.IsChecked()
config.conf["editableText"]["caretMoveTimeoutMs"]=self.caretMoveTimeoutSpinControl.GetValue()
for index,key in enumerate(self.logCategories):
config.conf['debugLog'][key]=self.logCategoriesList.IsChecked(index)
Expand Down
19 changes: 9 additions & 10 deletions user_docs/en/userGuide.t2t
Original file line number Diff line number Diff line change
Expand Up @@ -1688,6 +1688,15 @@ Enabled by default, this option allows you to choose if gestures (such as key pr
As an example, if enabled and the letter j was pressed, it would be trapped from reaching the document, even though it is not a quick navigation command nor is it likely to be a command in the application itself.
In this case NVDA will tell Windows to play a default sound whenever a key which gets trapped is pressed.

==== Automatically set system focus to focusable elements ====[BrowseModeSettingsAutoFocusFocusableElements]
Key: NVDA+8

Disabled by default, this option allows you to choose if the system focus should automatically be set to elements that can take the system focus (links, form fields, etc.) when navigating content with the browse mode caret.
Leaving this option disabled will not automatically focus focusable elements when they are selected with the browse mode caret.
This might result in faster browsing experience and better responsiveness in browse mode.
The focus will yet be updated to the particular element when interacting with it (e.g. pressing a button, checking a check box).
Enabling this option may improve support for some websites at the cost of performance and stability.

+++ Document Formatting (NVDA+control+d) +++[DocumentFormattingSettings]
Most of the checkboxes in this category are for configuring what type of formatting you wish to have reported as you move the cursor around documents.
For example, if you check the report font name checkbox, each time you arrow onto text with a different font, the name of the font will be announced.
Expand Down Expand Up @@ -1806,16 +1815,6 @@ This option enables behaviour which attempts to cancel speech for expired focus
In particular moving quickly through messages in Gmail with Chrome can cause NVDA to speak outdated information.
This functionality is experimental as of NVDA 2020.2.

==== Automatically set system focus to focusable elements in Browse Mode ====[BrowseModeSettingsAutoFocusFocusableElements]
Key: NVDA+8

Enabled by default, this option allows you to choose if the system focus should automatically be set to elements that can take the system focus (links, form fields, etc.) when navigating content with the browse mode caret.
If enabled, this represents default behaviour of NVDA as of version 2019.1 and before.
Disabling this option will not automatically focus focusable elements when they are selected with the browse mode caret.
This might result in faster browsing experience and better responsiveness in browse mode.
The focus will yet be updated to the particular element when interacting with it (e.g. pressing a button, checking a check box).
This functionality is experimental as of NVDA 2019.2.

==== Caret move timeout (in MS) ====[AdvancedSettingsCaretMoveTimeout]
This option allows you to configure the number of milliseconds NVDA will wait for the caret (insertion point) to move in editable text controls.
If you find that NVDA seems to be incorrectly tracking the caret E.g. it seems to be always one character behind or is repeating lines, then you may wish to try increasing this value.
Expand Down