Skip to Content
Soundor Components
Guides

Keyboard and accessibility

Shortcuts, pointer tips and what screen readers get from each control.

Every control can be used without a pointer, and the same shortcuts work in every runtime. They also apply to a custom control built on a headless hook.

Moving between controls

Tab and Shift+Tab move focus through the controls in the order they are drawn. A focus ring shows around the focused control, only for keyboard focus: a click or a double-click never draws it. Disabled controls are skipped.

Inside a SegmentedControl the group is a single stop, and the arrow keys move within it.

Shortcuts

For a binding you implement with Soundor keyboard events, formatShortcut('Mod+Shift+Z') from @soundor/components formats its label as ⇧⌘Z on macOS and Ctrl+Shift+Z on Windows and Linux. Use { spoken: true } for words instead of symbols. Check for conflicts with DAW shortcuts before choosing a binding.

Knob, Slider, Fader and ValueField

InputDoes
← ↓ / → ↑Decrease / increase by 1% of the range
Page Down / Page UpDecrease / increase by 10% of the range
Home / EndGo to the minimum / maximum
Delete or BackspaceReset to the default
Shift with any key aboveTen times finer
Mouse wheelChange by 1% per notch, Shift for finer
DragChange; Shift while dragging for fine control
Double-clickReset to the default; type a value on a ValueField
Alt-click (Option-click)Reset to the default, ValueField included
Esc while draggingCancel the drag and restore the value

Steps follow the control's mapping, so on a log-scaled frequency control 1% is a step along the curve, not a fixed number of hertz. A Slider pressed on its thumb grabs it where it is; pressed elsewhere, it jumps there and then follows the pointer (hold Shift to grab the thumb where it is from anywhere). A double-click resets it only on the thumb: one elsewhere jumps, and resets nothing.

ValueField takes a double-click or Enter to type a value, and Enter again to apply it or Esc to leave it unchanged. See Typing a value for what it accepts.

Buttons

InputDoes
Enter or SpacePress a Button, switch a Toggle
← ↑ / → ↓Select the previous / next option
Home / EndSelect the first / last option

In a SegmentedControl the selection follows focus and wraps around at the ends.

XYPad and draggable Plot markers

InputDoes
← / →Decrease / increase X
↓ / ↑Decrease / increase Y
Shift with an arrowTen times finer
Delete or BackspaceReset both axes to their defaults
DragMove both values; Shift for fine control
Double-click on the handleReset both axes to their defaults
Alt-click (Option-click)Reset, as a double-click does
Esc while draggingCancel the drag

An XYPad pressed on its handle grabs it where it is; pressed elsewhere, the handle jumps to the pointer, and a double-click there jumps without resetting. Every marker with onMove on a Plot is its own tab stop and behaves like an XYPad, except that a marker never jumps: it is grabbed where it is.

Select, DropdownMenu and ContextMenu

InputDoes
Enter, Space (and ↓ ↑ on a Select)Open; focus goes into the list or menu
Shift+F10 or the context menu keyOpen a ContextMenu beside the focused control
↑ / ↓, Home / End, Page Up / Page DownMove, skipping disabled items and dividers
A letterThe next item whose label starts with it
Enter or SpaceChoose
Esc, Tab or a click outsideClose, and give focus back to where it was

A list or menu keeps focus while it is open, and holds it inside the editor. Esc closes the topmost one only: a menu opened from a Modal closes and leaves the modal open.

EnvelopeEditor

Each handle is a tab stop. On the attack, sustain and release handles the arrow keys, Page Up, Page Down, Home, End and the wheel work as on a Knob; on the decay handle, ← → move the decay and ↓ ↑ the sustain. Double-click, Alt-click, Delete or Backspace resets a handle's stage (on the decay handle, the decay only: the sustain has its own), and Esc cancels a drag. See EnvelopeEditor.

ResizeGrip

← → ↑ ↓ resize the editor by a few pixels; Shift makes the step five times larger.

Tips

  • Fine adjustment is Shift. It works on keys, wheel and drag alike, so it is the one habit worth teaching.
  • Double-click is the reset, and so are Alt-click and Delete. Alt-click (Option-click on a Mac) is the reset in Pro Tools and Logic, and the one that works on a ValueField too, where a double-click types a value. Set the parameter's default and users always have a way back. Bound controls take it from the parameter; others take defaultValue.
  • Typing beats dragging for exact values. A ValueField beside a Knob or a Fader gives both.
  • Cancel with Esc. A drag is one gesture for the host, and Esc cancels it and restores the value from before.

What assistive technology gets

ControlRoleWhat it reports
Knob, Slider, Fader, ValueFieldadjustableLabel, formatted value, minimum, maximum
XYPad, Plot markeradjustableBoth values in one phrase, such as "Cutoff 1.20 kHz, Resonance 35%"
ButtonbuttonLabel, disabled
Toggleswitch or togglebuttonLabel, on or off
SegmentedControlradiogroup of radioGroup label, each option, which one is selected
LevelMeterprogressbarLabel and level; the clip indicator is a button that clears it
PlotimageIts accessibilityLabel, or its title
Selectcombobox, then a menuLabel, chosen option, whether it is open; each option, the chosen one checked
DropdownMenu, ContextMenumenu of menuitemThe menu's label, item labels and hints, disabled and checked items
EnvelopeEditor handleadjustableThe stage's name and value, such as "Decay 300 ms, Sustain 65%"
Panel, ControlGroupheaderThe title

Adjustable controls also offer the actions a screen reader lists: increment, decrement, set value and reset to default. An XYPad adds Increase and Decrease for its Y axis.

Actions of your own

Every control takes accessibilityActions and onAccessibilityAction. Your actions are offered after the control's own, which stay first and stay the control's: an action named like one of its own is left out, and asking for one of its own never reaches your handler. A ContextMenu uses this to offer the platform's "show menu" action (showContextMenu), after the control's own: its trigger keeps the control's role, name and value.

<Knob
  parameter={parameters.cutoff}
  accessibilityActions={[{ name: 'learn', label: 'MIDI learn' }]}
  onAccessibilityAction={(event) => {
    if (event.actionName === 'learn') startLearn('cutoff');
  }}
/>

Every control also takes a ref to the node assistive technology is on (a SegmentedControl's is its group, and its options each offer your actions). A DropdownMenu places its menu beside its trigger by that ref.

Making your plug-in accessible

  • Give every control a name. A bound control takes its label from the parameter. Without one, pass label or accessibilityLabel: a nameless knob is announced as a number alone.
  • Describe what is not obvious. accessibilityHint is read after the name: "Drag, or use the arrow keys" is built in for the resize grip, and your own hints belong on anything unusual.
  • Label plots, and say what they show. A Plot is announced as an image, so accessibilityLabel="Compressor transfer curve" is what a screen reader user gets. Put the numbers that matter in a control beside it: a Plot's draggable markers are reachable, but the curve itself is not described.
  • Do not rely on colour. The clip and warning colours of a LevelMeter are also in its reported level, and the accent variants of a Button always have text. Keep that when you theme.
  • Keep focus visible. If you restyle a component with StyleProps, keep its focus ring, or draw your own from focusVisible in a headless hook.

On this page