|
| 1 | +# Tips for application developers |
| 2 | + |
| 3 | +## Introduction |
| 4 | + |
| 5 | +Please note: This document is a work in progress and will be expanded over time to include details |
| 6 | +about how to make accessible applications using AccessKit. |
| 7 | + |
| 8 | +## Other Resources |
| 9 | + |
| 10 | +Many accessible technologies have their own tips for application developers. See: |
| 11 | + |
| 12 | +* [Orca's Tips for Application Developers](https://gitlab.gnome.org/GNOME/orca/-/blob/main/README-APPLICATION-DEVELOPERS.md?ref_type=heads&plain=0) |
| 13 | +* [Apple's accesibility HIG](https://developer.apple.com/design/human-interface-guidelines/accessibility) |
| 14 | + |
| 15 | +## Using screen readers |
| 16 | + |
| 17 | +The best way to test applications for accessibility is with a screen reader. Here are some key commands to know: |
| 18 | + |
| 19 | +### macOS |
| 20 | + |
| 21 | +* Turn VoiceOver on or off with `Command + F5` (Some Macs require `Command + Function + F5`. If your Mac or Magic Keyboard has Touch ID, press and hold the Command key while you quickly press Touch ID three times.) |
| 22 | +* Move the VoiceOver cursor with `Control + Option + Arrow keys`, or by clicking with the mouse. |
| 23 | +* Perform the default action with `Control + Option + Space`. |
| 24 | +* Access a menu with `Control + Option + H + H` (pressing the H key twice). This provides a menu of all commands including developer ones. |
| 25 | +* More commands [here](https://support.apple.com/guide/voiceover/general-commands-cpvokys01/mac). |
| 26 | + |
| 27 | +### Linux |
| 28 | + |
| 29 | +orca can be enabled from the settings screen in many desktop environments, as well as by running `orca` on the command line. `orca --setup` will |
| 30 | +open a configuration pane, and `orca --debug-file=file.log` will log debug information to a file which can be useful for |
| 31 | +debugging applications. |
| 32 | + |
| 33 | +orca's keyboard configurations come in two flavors, the 'Desktop' (default) and 'Laptop' configurations. This document discusses |
| 34 | +the Desktop flavor. |
| 35 | + |
| 36 | +* 'Where am I?' is `Keypad Enter` (press twice for more info) |
| 37 | +* Move focus with `Insert + Ctrl + Arrow key` |
| 38 | +* Speak current item with `Insert + Shift + Up Arrow` |
| 39 | +* Present object actions with `Insert-Shift-a` |
| 40 | +* Speak entire window with Flat Review with `Keypad Add + Keypad Add` (pressing the plus key twice) |
| 41 | +* To get a menu of all shortcuts on your system, use `Insert + H` to enter learn mode, and then `F2`. |
| 42 | +* More information about Orca is available [here](https://help.gnome.org/users/orca/stable/index.html.en). |
| 43 | + |
| 44 | +Problems with orca can sometimes be resolved by removing user settings at `~/.local/share/orca` and relaunching orca. |
| 45 | + |
| 46 | + |
| 47 | +## Using accessibility inspectors |
| 48 | + |
| 49 | +Accessibility inspectors provide a convenient way to inspect your accessibility tree. However, they can be very |
| 50 | +misleading in terms of how screen reader users experience an application. |
| 51 | + |
| 52 | +### macOS |
| 53 | + |
| 54 | +on macOS you can use the Accessibility Inspector, which is part of Xcode. See the documentation at [Apple's developer site](https://developer.apple.com/documentation/accessibility/accessibility-inspector). |
| 55 | + |
| 56 | +Accessibilty Inspector provides GUI buttons for navigation through the application and visually displays properties. It includes |
| 57 | +some auditing tools to look for common issues in your application. |
| 58 | + |
| 59 | +The macOS tooling is of reasonably high quality for common tasks but does not always surface issues that are important |
| 60 | +for screen reader users. |
| 61 | + |
| 62 | +### Linux |
| 63 | + |
| 64 | +The GNOME project provides the [accerciser](https://help.gnome.org/users/accerciser/stable/introduction.html.en) inspector. |
| 65 | +It provides a basic tree view of the accessibility tree and can be used to inspect properties of nodes and run |
| 66 | +some simple audits. |
| 67 | + |
| 68 | +accerciser has many limitations. It often fails to show node properties in complex trees and cannot display the tree |
| 69 | +for the orca setup window for example. It often hangs and crashes on complex trees, it does not provide a facility to focus or navigate nodes in the tree or send |
| 70 | +most events to applications. And it will not display |
| 71 | +trees created by accesskit on its own because it does not enable the ATSPI bus. (To do this, turn on a screenreader or |
| 72 | +run this command: `busctl --user set-property org.a11y.Bus /org/a11y/bus org.a11y.Status IsEnabled b true` |
| 73 | + |
| 74 | +The KDE project provides the [Accessibility Inspector](https://apps.kde.org/accessibilityinspector/) application. In general |
| 75 | +it is superior to accerciser, it can display the tree for orca's setup window, it provides a checkbox to enable the ATSPI bus, |
| 76 | +and it supports focusing and navigating nodes in the tree to some extent. However it still frequently crashes and hangs |
| 77 | +and provides no audit functionality. |
| 78 | + |
| 79 | +Both inspectors often display information that is totally inaccessible to screen reader users and so relying on them |
| 80 | +to test accessibility can be misleading. |
| 81 | + |
| 82 | +## About virtualization |
| 83 | + |
| 84 | +Many developers use virtualization to test their software on other platforms. However, using virtualization to test accessibility |
| 85 | +has some unique challenges. |
| 86 | + |
| 87 | +### Sound |
| 88 | + |
| 89 | +Linux often has choppy audio under virtualization due to its small audio buffers, and this may make it difficult to hear if |
| 90 | +a screen reader is reading or to understand its speech. Placing the following in |
| 91 | +`~/.config/wireplumber/wireplumber.conf.d/50-alsa-config.conf` can help: |
| 92 | + |
| 93 | +``` |
| 94 | +monitor.alsa.rules = [ |
| 95 | + { |
| 96 | + matches = [ |
| 97 | + # This matches the value of the 'node.name' property of the node. |
| 98 | + { |
| 99 | + node.name = "~alsa_output.*" |
| 100 | + } |
| 101 | + ] |
| 102 | + actions = { |
| 103 | + # Apply all the desired node specific settings here. |
| 104 | + update-props = { |
| 105 | + api.alsa.period-size = 1024 |
| 106 | + api.alsa.headroom = 8192 |
| 107 | + } |
| 108 | + } |
| 109 | + } |
| 110 | +] |
| 111 | +``` |
| 112 | + |
| 113 | +### Input |
| 114 | + |
| 115 | +Popular virtualization software interferes with the keyboard shortcuts used with screen readers. This can cause |
| 116 | +screen readers to seemingly not respond, or respond incorrectly or inconsistently to keyboard commands. |
| 117 | + |
| 118 | +One workaround is to mount a keyboard for the exclusive use of the guest. (A full-size keyboard is recommended since |
| 119 | +screen readers use many keys.) This feature is disabled by default in VMWare; to enable it, append the following |
| 120 | +to the vmx file: |
| 121 | + |
| 122 | +```angular2html |
| 123 | +usb.generic.allowHID = "TRUE" |
| 124 | +usb.generic.allowLastHID = "TRUE" |
| 125 | +``` |
0 commit comments