Skip to content

Commit

Permalink
Implement tab navigation (nvaccess#15332)
Browse files Browse the repository at this point in the history
Link to issue number:
nvaccess#15046

Summary of the issue:
The lack of the ability to quickly switch to tabs complicates navigation

Description of user facing changes
Users will be able to switch between tabs in web documents, by assigning the appropriate gesture.

Description of development approach
Added another elif into _searchableAttribsForNodeType method in iaccessible, UIA and mshtml classes.
Added quick nav for tab navigation.
  • Loading branch information
Danstiv authored Sep 1, 2023
1 parent ce32058 commit 128f683
Show file tree
Hide file tree
Showing 6 changed files with 47 additions and 0 deletions.
5 changes: 5 additions & 0 deletions source/UIAHandler/browseMode.py
Original file line number Diff line number Diff line change
Expand Up @@ -486,6 +486,11 @@ def _iterNodesByType(self,nodeType,direction="next",pos=None):
)
])
return UIAControlQuicknavIterator(nodeType, self, pos, condition, direction)
elif nodeType == "tab":
condition = UIAHandler.handler.clientObject.createPropertyCondition(
UIAHandler.UIA_ControlTypePropertyId, UIAHandler.UIA_TabItemControlTypeId
)
return UIAControlQuicknavIterator(nodeType, self, pos, condition, direction)
elif nodeType=="nonTextContainer":
condition=createUIAMultiPropertyCondition({UIAHandler.UIA_ControlTypePropertyId:UIAHandler.UIA_ListControlTypeId,UIAHandler.UIA_IsKeyboardFocusablePropertyId:True},{UIAHandler.UIA_ControlTypePropertyId:UIAHandler.UIA_ComboBoxControlTypeId})
return UIAControlQuicknavIterator(nodeType,self,pos,condition,direction)
Expand Down
11 changes: 11 additions & 0 deletions source/browseMode.py
Original file line number Diff line number Diff line change
Expand Up @@ -920,6 +920,17 @@ def _get_disableAutoPassThrough(self):
# Translators: Message presented when the browse mode element is not found.
prevError=_("no previous grouping")
)
qn(
"tab", key=None,
# Translators: Input help message for a quick navigation command in browse mode.
nextDoc=_("moves to the next tab"),
# Translators: Message presented when the browse mode element is not found.
nextError=_("no next tab"),
# Translators: Input help message for a quick navigation command in browse mode.
prevDoc=_("moves to the previous tab"),
# Translators: Message presented when the browse mode element is not found.
prevError=_("no previous tab")
)
del qn


Expand Down
6 changes: 6 additions & 0 deletions source/virtualBuffers/MSHTML.py
Original file line number Diff line number Diff line change
Expand Up @@ -401,6 +401,12 @@ def _searchableAttribsForNodeType(self,nodeType):
"name": [VBufStorage_findMatch_notEmpty]
},
]
elif nodeType == "tab":
attrs = [
{
"IAccessible::role": [oleacc.ROLE_SYSTEM_PAGETAB],
},
]
elif nodeType == "embeddedObject":
attrs = [
{"IHTMLDOMNode::nodeName": ["OBJECT", "EMBED", "APPLET", "AUDIO", "VIDEO", "FIGURE"]},
Expand Down
4 changes: 4 additions & 0 deletions source/virtualBuffers/gecko_ia2.py
Original file line number Diff line number Diff line change
Expand Up @@ -543,6 +543,10 @@ def _searchableAttribsForNodeType(self,nodeType):
},
{"IAccessible::role":[oleacc.ROLE_SYSTEM_APPLICATION,oleacc.ROLE_SYSTEM_DIALOG]},
]
elif nodeType == "tab":
attrs = [
{"IAccessible::role": [oleacc.ROLE_SYSTEM_PAGETAB]}
]
else:
return None
return attrs
Expand Down
1 change: 1 addition & 0 deletions user_docs/en/changes.t2t
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ What's New in NVDA
-
- When using automatic detection of braille displays, it is now possible to opt-out drivers from detection from the braille display selection dialog. (#15196)
- A new option in Document Formatting settings, "Ignore blank lines for line indentation reporting". (#13394)
- Added an unassigned gesture to navigate by tab groupings in browse mode. (#15046)
-

== Changes ==
Expand Down
20 changes: 20 additions & 0 deletions user_docs/en/userGuide.t2t
Original file line number Diff line number Diff line change
Expand Up @@ -814,6 +814,26 @@ If you want to use these while still being able to use your cursor keys to read
To toggle single letter navigation on and off for the current document, press NVDA+shift+space.
%kc:endInclude

+++ Other navigation commands +++[OtherNavigationCommands]

In addition to the quick navigation commands listed above, NVDA has commands that have no default keys assigned.
To use these commands, you first need to assign gestures to them using the [Input Gestures dialog #InputGestures].
Here is a list of available commands
- Article
- Grouping
- Tab
-
Keep in mind that there are two commands for each type of element, for moving forward in the document and backward in the document, and you must assign gestures to both commands in order to be able to quickly navigate in both directions.

For example, if you want to use the ``y`` / ``shift+y`` keys to quickly navigate through tabs, you would do the following

+ Open input gestures dialog from browse mode.
+ Find "moves to the next tab" item in the Browse mode section.
+ Assign ``y`` key for found gesture.
+ Find "moves to the previous tab" item.
+ Assign ``shift+y`` for found gesture.
+

++ The Elements List ++[ElementsList]
The elements list provides access to a list of various types of elements in the document as appropriate for the application.
For example, in web browsers, the elements list can list links, headings, form fields, buttons or landmarks.
Expand Down

0 comments on commit 128f683

Please sign in to comment.