|
|
Subscribe / Log in / New account

Accessibility and the graphics stack

By Jake Edge
October 22, 2014

X.Org Developers Conference

At the 2014 X.Org Developers Conference, Samuel Thibault led off three days of presentations with a look at accessibility and how it relates to the X and Wayland graphics stacks. Accessibility is the blanket term for making computers more usable by people with specific needs—not necessarily handicaps. Those needs range from vision problems to loss of motor control, which might be temporary (e.g. a broken arm) or more permanent (e.g. blindness, deafness, or Parkinson's disease)

[Samuel Thibault]

Introduction

Thibault started the talk with a slide of gnuplot output and asked what accessibility problems it illustrated (slides [PDF]). Since the two functions plotted used red and green lines, the problem is for those with color blindness. He asked those who could not see one or more of the colors to raise their hands and got three from around fifty in the room. Roughly 8% of males and 0.5% of females are affected by color blindness.

Accessibility is helping people who have special needs when interacting with a computer. Blindness is an obvious candidate, but there are also people who have low vision (or color blindness). Deafness is not really an issue for X.Org, but it clearly requires changes to assist those who are affected by it. There are people who can only use one hand ("try to press ctrl-alt-backspace with one hand", he said) or with motor control issues. Elderly people often have several different needs all at once.

But, he asked, why make the graphical user interface (GUI) accessible when text mode is so much easier to handle? There are many things that are not available in text mode, however, JavaScript support for example. There are also business applications that are GUI-oriented. Beyond that, non-technical people need to be able to get help from others, but that is much harder if the two are not running the same applications.

One approach might be to make dedicated software for those with special needs, but that is generally a bad idea, Thibault said. Typically, those types of applications are oriented toward a single disability. His example was edbrowse, which is a combination editor and browser targeted at blind users. That means it is not helpful for those with other disabilities.

Developers would need to work on both the browser (e.g. JavaScript, Flash, and CSS) and on office suite features such as compatibility with Microsoft Office and OpenOffice. With limited developer resources, that becomes an unneeded duplication of effort. Also, when both disabled and non-disabled people are working together, it would be best to be using the same software.

So, one of the design principles for the accessibility work is that it uses the same software, but makes it accessible. That makes it easier to work together and to get help from others. Another principle is that it should support "synchronized work" for two people working together; it should just alternate input and output mechanisms as needed to support both users. Finally, accessible software should be pervasive; it should not require a special software installation or configuration, it should just be available to be enabled on "all platforms all the time".

The status of accessibility support in free software is a bit of a mixed bag. Text mode is generally accessible, he said, but is not good for beginners. GNOME is "quite accessible", though GNOME 3 was a restart from scratch on accessibility. But free software is late compared to Windows, which has a many-year lead on accessibility. Compared to Apple, though, free software support is "Stone Age". The accessibility in Apple's products is easily available and well integrated.

Pressing "a"

Next up was a look at input and output in X, with an eye toward where accessibility fits in. When you press an "a" on a keyboard, it doesn't matter what is printed on that key, it is the first key on the third row and gets converted to a scancode (0x1e) that represents that location. The keyboard driver in the kernel turns that into an internal kernel value (KEY_A, which is 30 or 0x1e) and passes it to the input driver and then to the evdev driver. The evdev driver creates an event that it hands to the input-evdev driver in the X server, which adds 8 (for reasons that were not explained in the talk) before pushing it out over the wire to the X client as a KeyPress.

It is important to recognize that it is still just a location on the keyboard (first key of third row) at that point. The client toolkit will get the event, recognize that it is a KeyPress, and hand it off to Xkb, which finally translates it into a KeySym: an "a". At that point, the KeySym is sent to the widget it was directed at, which may decide to do something with it.

Perhaps the widget wants to append the "a" to its text. These days, clients will typically use a library like Pango to render the text. That generates a PixMap, which is pushed to the driver and the video card to display. It is important to notice that the PixMap is generated early, in the client. But, there may not be a screen to direct the PixMap to. Blind people do not have screens and do not want them. There need to be alternatives on the output side so that blind people do not have to buy screens they will not use.

Input

Certain people can only use certain kinds of input devices. There are those who can only use keyboards; they need to use keyboard shortcuts and to move the cursor using it. Others can only use a joystick (as a mouse, essentially) or only a mouse—to type they have to use some kind of virtual keyboard. There are many more kinds of input devices, because "you never know what people may need".

If you can only use one hand and it is a permanent condition, you may want a faster way to input text. Using a standard keyboard requires a lot of hand motion. One way to deal with that is to have a key that "mirrors" the keyboard, effectively switching between the keys on each side without moving the hand. Thibault initially said that it might be difficult to do that in X, but an audience member said that Xkb can already do those kind of remappings.

AccessX adds a number of features to Xkb and X clients that can be used for accessibility. StickyKeys allows someone to press modifier keys (e.g. ctrl, alt, shift) multiple times to make them "stick" so they can input things like "ctrl-alt-backspace". MouseKeys turns the keyboard into a mouse. For those who have trouble moving their hands quickly or often initially miss the key they wanted, SlowKeys will wait for a bit before deciding a key has been pressed. BounceKeys is useful for those with Parkinson's or other motor control problems; it will see only one key press even if there are several of them in a short period of time. There are others as well.

A virtual keyboard is available with xvkdb. It injects physical positions as KeyPress events on the wire, directly to the client. Some braille devices have regular PC keyboards, so brltty just hands key symbols (e.g. KEY_A) to the kernel input driver.

Actual braille keyboards are a harder problem. These have eight keys that correspond to the eight dots in braille. That gives 256 possibilities, but the representation of some characters and their braille equivalents are not standard. "a" to "z" are standard, but the rest depend on both language and country—Belgian French, Canadian French, and French in France do not share the same symbol mappings. Because a key press is not really a physical position on a standard keyboard, it results in brltty creating a KeySym, rather than a KeyPress. Xkb is used to back-translate the "a" to a KeyPress then to send it into the client.

There are a number of other issues with braille, including users wanting to use certain keys on a regular keyboard to represent the dots from a braille keyboard, composing certain characters (e.g. "ô"), and handling braille abbreviations (which sometimes map to regular characters, with rules to disambiguate). Handling all of that is complex, but some of it will be moving to use ibus soon. Support for ibus was just completed in the most recent Google Summer of Code cycle.

He then asked the audience: what about Wayland? He wondered if it was passing keyboard codes or KeySyms. Ideally, he said, it would handle both which would help remove some of the existing complexity. Someone replied that Wayland was using keyboard codes currently, but it might be possible to change that.

Output

On the output side, there are already a fair number of features that are available. People with low vision can tweak the DPI setting which will result in larger icons and fonts. XRandR can be used for panning and to do some basic zooming; there is also support for gamma tuning and color inversion for assisting those with color blindness. In addition, GTK 3 has a method to do perfect zooming by rendering into a much larger PixMap.

All of that doesn't really help blind people, however. In order to provide information for them, the application must help. In the past, snooping the X protocol was used to help determine what text was being displayed and its context, but that no longer works as PixMaps are sent over the wire. So applications need to have an abstract representation of the information they are displaying that can be passed to a screen reader over a bus. Then the screen reader can "render" the information in a sensible fashion.

So the widget that receives the "a" and is displaying it will also send a signal via the Accessibility Toolkit (ATK) to the screen reader. But that information also needs some context, including the hierarchy of widgets, windows, and so on. Similar to CSS, the application needs to describe its windows, menus, labels, buttons, etc. in a way that the screen reader can query. It can then do the right thing for the user when it puts it on a braille device, speaks the data aloud, or outputs it in some other way.

Making applications accessible from the start is fairly easy, Thibault said. It is a matter of designing without the GUI in mind. If you use the standard widgets, they have already been made accessible. In addition, images should always have some alternate text that the screen reader can use.

There is a tool for testing an application for accessibility called Accerciser. It will show the application and the tree of widgets, so that you can see what a screen reader would get.

Thibault concluded by saying that accessibility has diverse requirements that causes it to have to be plugged in at various levels. When moving to Wayland, there should be no regressions in terms of accessibility, which means that developers need to be paying attention to that now. In the end, accessibility needs the semantics from a desktop application, not just the rendering, so it is important to separate form from content.

For those interested, there is a video [WebM] and, interestingly, a transcript of Thibault's talk.

[ I would like to thank the X.Org Foundation for travel assistance to Bordeaux for XDC. ]


Index entries for this article
ConferenceX.Org Developers Conference/2014


to post comments

Accessibility and the graphics stack

Posted Oct 23, 2014 8:23 UTC (Thu) by nim-nim (subscriber, #34454) [Link] (8 responses)

Actually, when inputing text, you have four (not two) different concepts:

1. the hardware key location (hardware or virtal hardware)
2. the symbol code this location is mapped to (unicode codes or application actions)
3. the language which is being inputed (language being actually a locale, the same language is not written the same way everywhere, the unicode/opentype rendering changes, the spellcheck dictionnary changes, you can not give safely symbols to apps without locale context)
4. the app localization (the locale used to render its UI) Actually this fourth is a fake, it should not matter a bit on the input side, but C locales confuse it with the rest so it participates in the problem today when it should not

To get accessibility and i18n working (and you need to do both simultaneously, every disabled person does not work in a single locale and every locale has both disabled and non disabled persons) your stack must work very hard to avoid confusing the four concepts.

So, while you may want to transmit both keyboard codes and keysyms to apps, it is a very dangerous thing to do. Because then app devs confuse both concepts and map keyboard locations to actions (many many games make this mistake, starting with the "console key" which is *not* a console key and is needed to input human languages in various parts of the world). They assume those locations are "free to use" because in *their* locale those locations do not map to symbols they care about. And then the app is not i18n-safe, switching to any i18n mapping that uses the same location for something important to this particular locale will break. A localized app must allow a different mapping for actions per locale, keys symbols available for action overriding are not the same in every locale.

So by all means allow virtual keyboards to emit key locations, but this should never ever be exposed to anything but the component responsible from mapping those locations to symbols. Otherwise different parts of the app stack will fight for the ownership of the key locations, depending of which part wins things will break and users will be unhappy.

Likewise X (and IIRC wayland too) makes the mistake of confusing the input mapping with the language being inputed. They are not one and the same, it is common for the same symbol to be mapped to different locations depending on the layout the user uses (typically, azerty vs qwerty, so a and z move), but that does not mean the user of an azerty (French) layout wants a and q to be switched when he starts writing English text. As the article states "Belgian French, Canadian French, and French in France do not share the same symbol mappings". They are all used to input French. A Belgian braille user do not want his mapping to change just because he is contributing to a document in Canadian French (the dictionnaries are not exactly the same, you use the one of the target locale).

But there is no way to indicate apps the target language you are writing, so most of them infer it from the your input mapping ! This is seriously broken compared to other OSes. And don't get me started on the common UI locale = text locale confusion (many people work in an English locale because they feel the UI localization sucks, but they are still writing text for non-English locale targets)

So while reusing x input concepts in wayland was a good idea to get started quickly, they really need a refresh unless wayland gets stuck with the same i18n and atk problems that plagued X for decades.

Accessibility and the graphics stack

Posted Oct 23, 2014 9:28 UTC (Thu) by daniels (subscriber, #16193) [Link] (5 responses)

a) Neither X11 nor Wayland have any notion of a UI locale. All they provide is keyboards with a specified mapping; that's it.

b) Wayland does offer a keysym-based interface which is entirely usable by specialist input methods (e.g. Maalit has been ported for a couple of years), and at no point requires decomposition to keycodes. This is something which would be perfectly usable by a braille input method, today, without any changes. The only reason the keycode-based interface also exists is because you can't handle shortcuts otherwise.

c) Wayland and X11 share the XKB _dataset_ (and not protocol) for keymaps and layout handling. Everything else was done from scratch.

d) The reason for the offset-by-8 is that the minimum valid keycode in X11 is 8, whereas it's 0 with evdev. So we just blindly add 8 to the keycode mapping; something which survived into Wayland because the dataset already reflected that.

Accessibility and the graphics stack

Posted Oct 23, 2014 16:02 UTC (Thu) by nim-nim (subscriber, #34454) [Link] (4 responses)

We agree that a) is the only thing available in GUI. UI is locale is available from lower in the stack. However since it is *not* what apps need it is a problem.

What apps want is :
1. the locale of the text which is being written (to apply spellcheck and other locale-specific processing), ie the language toolbar MS deployed for office then generalized in the 90's
2. what hardware key combos are free to use for keyboard shortcuts (and how they are labelled/where they are located so they can show something in config settings)

Since the only thing they can get is a) they try to infer the rest from it which can not work reliably since a) is not designed for that.

Accessibility and the graphics stack

Posted Oct 23, 2014 16:32 UTC (Thu) by daniels (subscriber, #16193) [Link]

Again, shortcut handling belongs at a higher level than raw keyboard layout handling. This has to account for things like negotiation between global and local shortcuts (e.g. when the media keys such as Play are pressed, who handles it? if the foreground application, then use that, else try to find a backgrounded media player?).

The shortcut handling itself is also intensely difficult - for instance, when you have mixed layouts such as Russian and US, you want to base the shortcuts on the US layout, but then you can throw in mixed Dvorak/US for fun.

It's not that this isn't supported, but just that it's the wrong level to support it. The kernel doesn't deal with keymaps at all and just forwards on keycodes at all; the window system doesn't, at its lowest/fundamental level, deal with shortcuts or locales either.

Nothing in Wayland precludes this from being built on top, at all; in fact, it was designed with the explicit intent of being able to do so.

Accessibility and the graphics stack

Posted Oct 30, 2014 16:50 UTC (Thu) by arielb1@mail.tau.ac.il (guest, #94131) [Link] (2 responses)

Wayland is not in the business of handling locale settings (whether the dictionary should be French or French-Canadian). It does provide keymaps, which translate physical keyboard buttons to the symbols printed on them.

Accessibility and the graphics stack

Posted Oct 30, 2014 21:43 UTC (Thu) by mathstuf (subscriber, #69389) [Link] (1 responses)

> the symbols printed on them

Guess I'm screwed[1] then, huh? :P

[1]http://cdn.shopify.com/s/files/1/0152/0433/products/Top_V...

Accessibility and the graphics stack

Posted Nov 2, 2014 15:41 UTC (Sun) by nix (subscriber, #2304) [Link]

No, no, you just get a whole bunch of XK_space out the other end!

Accessibility and the graphics stack

Posted Oct 24, 2014 20:27 UTC (Fri) by epa (subscriber, #39769) [Link] (1 responses)

Yes, I've never understood why switching input language should also switch the keyboard layout at the same time. If the key is marked Q or @ it should stay like that and not change to A or " just because I want a different spellchecker. I think all major platforms (Win and Mac too) make this mistake. Odd, given the number of users who speak more than one language and need to work in both (without plugging in a new keyboard each time...)

Accessibility and the graphics stack

Posted Oct 25, 2014 8:09 UTC (Sat) by nim-nim (subscriber, #34454) [Link]

Actually, they do not make this mistake, the windows language bar for example let the user map different locales to the same layout from day one (it certainly helped that it was originally written by the office team which understands text constrains; but it was never restricted to office unlike the various toys we get *nix-side)

You can see from dstone denials understanding still has not come to the X/wayland devs (so much the pity)

Accessibility and the graphics stack

Posted Oct 23, 2014 15:12 UTC (Thu) by sfeam (subscriber, #2841) [Link] (1 responses)

Since the talk and article start off by using gnuplot output as an example of poor accessibility, I'd like to point out that gnuplot's default color scheme has changed in version 5 (2nd release candidate out for a couple of months now) to one derived from the set of colors recommended by Wong [Nature Methods 8, 441]. Wong's colors are specifically chosen to be distinguishable by color-blind individuals with either protanopia or deuteranopia. But it's also worth noting that any color choice needs to be re-checked after it has been converted/mangled/repurposed into the final output medium. The colors used for a beamer projection may or may not work if printed on a CMYK printer, and so on.

Has there been any thought about providing standard sets of accessible colors with appropriate tags for output medium? Some sort of virtual color library?

Accessibility and the graphics stack

Posted Oct 23, 2014 17:40 UTC (Thu) by sthibaul (✭ supporter ✭, #54477) [Link]

Oh, I didn't know gnuplot had at last changed its default colorset. I
once tried to explain their maintainers that, even for a start, pure
red and pure green gets a really bad contrast over white, whatever the
output device (it's actually completely unreadable on most beamers), to
no avail.

I'm glad they changed their mind and even completely included
accessibility concerns there!

Accessibility and the graphics stack

Posted Oct 23, 2014 16:45 UTC (Thu) by flussence (guest, #85566) [Link]

Does BounceKeys work on mice? I've encountered flaky microswitches in those things with annoying regularity and it'd be nice if I could use that to filter out the "release, sub-10ms delay, press" sequences.


Copyright © 2014, Eklektix, Inc.
This article may be redistributed under the terms of the Creative Commons CC BY-SA 4.0 license
Comments and public postings are copyrighted by their creators.
Linux is a registered trademark of Linus Torvalds