Skip to content

How to control Tree Style Tab via speech recognition

YUKI "Piro" Hiroshi edited this page Jul 15, 2021 · 5 revisions

(generated by Table of Contents Generator for GitHub Wiki)

Tree Style Tab 3.7.5 and later provides some accessibility information for its sidebar. They should help you to navigate TST's UI via speech recognition software like Dragon.

This document aims to provide some hints to customize TST for such a usecase. Contents of this page is based on discussions in the issue #2864.

Make tabs and in-tab buttons more easily clickable via speech recognition

TST's tabs are treated as multiply selectable list options, and a tab contains some UI elements with button role:

  • Tab label: a target just for clicking the tab itself. It is same to the title of the page.
  • Twisty: a toggler of collapsed/expanded state. It is labeled as "collapse this tree" or "expand this tree".
  • Sound button: a toggler of muted state. It is labeled as "mute tab" or "unmute tab".
  • Close button: a button to close the tab or its descendants. It is labeled as "close this tab" or "close this tree".

Speech recognition software may let you to click those buttons with saying their name, but sometimes it is hard if there are too many tabs. Instead you can give more short name for each tab and buttons based on their visual position. Here is an example user CSS (copy them and paste to TST's options => "Advanced" => "Extra style rules for contents provided by Tree Style Tab"):

#tabbar {
  counter-reset: vtabs atabs tabs;
  /* vtabs tracks visible tabs, atabs tracks active tabs, tabs tracks all tabs */
}
tab-item:not(.collapsed):not(.discarded) {
  counter-increment: vtabs atabs tabs;
}
tab-item:not(.collapsed) {
  counter-increment: vtabs tabs;
}
tab-item:not(.discarded) {
  counter-increment: atabs tabs;
}
tab-item {
  counter-increment: tabs;
}

tab-item,
tab-label,
tab-twisty,
tab-closebox,
tab-sound-button {
  -moz-user-focus: normal !important;
}

tab-item:not(.faviconized) .extra-items-container.front::after,
tab-item.faviconized tab-favicon::after {
  content: counter(vtabs);
  background: Highlight;
  bottom: 0.2em;
  color: HighlightText;
  font-size: x-small;
  right: 0;
  padding: 0.2em;
  pointer-events: auto;
  position: absolute;
  user-select:text;
  -moz-user-focus: normal;
  z-index: 1000;
}

tab-label::after,
tab-twisty::after,
tab-sound-button::before,
tab-closebox::before {
  max-height: 0;
  max-width: 0;
  opacity: 0;
  overflow: hidden;
  pointer-events: auto;
  position: absolute;
  user-select:text;
  -moz-user-focus: normal;
}

tab-label::after {
  content: "Item " counter(vtabs);
}

tab-twisty::after {
  content: "Toggler " counter(vtabs);
}

tab-sound-button::after {
  content: "Sound " counter(vtabs);
}

tab-closebox::after {
  content: "Closer " counter(vtabs);
}

With this CSS, a small tooltip will appear in each tab to indicate their position. For example, if you want to control a tab in the position "12", you can use these short names like:

  • "Click item 12": focus to the 12th tab directly.
  • "Click toggler 12": toggle collapsed/expanded state of the 12th tab directly.
  • "Click sound 12": toggle muted state of the 12th tab directly.
  • "Click closer 12": close the 12th tab directly.

Make the sidebar more easily scrollable via speech recognition

TST's built-in shortcuts

TST provides some commands for customizable keyboard shortcuts.

  • Scroll Tabs by Lines (up/down)
  • Scroll Tabs by Page (up/down)

On TST 3.7.5 and later you can change the number of scrolled lines via TST options => "Advanced" => "Scroll up or down XXX lines via...". (Please remind that you need to activate the "Unlock Expert Options checkbox placed top of the options page.)

Helper addon for more convenience

A helper addon TST More Tree Commands (version 1.3 or later) also provides commands for shortcuts:

  • Scroll Tabs by Some Lines (up/down)
  • Stop In-Progress Scroll of Tabs

The number of scrolled lines and the duration of animation are configurable via the options page. If you set both scrolled lines and duration to large values like 300 lines and 10000 msec, those shortcut commands will work like as : "start scrolling slowly" and "stop scrolling at favorite position".