Tuesday, February 17, 2009

Handicapped features in Linux

In the course of a discussion on Paul Murphy's ZDNet talkbacks, Roger Ramjet noted an issue with accessibility features for Linux.

First, background. Able people often don't consider the difficulties encountered by the handicapped in using a modern computer. With text-based (DOS) computers it was pretty easy... a screen reader for the blind and you're pretty much done. But with GUIs it's really, REALLY complicated. You have to be able to provide mouse control for people with impaired motor skills, key latches for people who don't have the use of both hands (and thus find it difficult to use key combinations like Ctrl-Alt-Del), magnifiers for people with poor vision... and the completely blind are truly in a fix, as they have to somehow hear about mouse position, etc., and their screen readers now have to communicate such information as menu options and links. It's very difficult to use a Graphical User Interface when you have no experience with graphical anything!

Windows provides certain accessibility features to overcome some of this, as does Linux. Roger's complaint had to do with MouseKeys, a feature designed for people who can't use a mouse. MouseKeys re-maps your numeric keypad so you can use it to control the mouse pointer and the mouse buttons. Roger notes that the default configuration for this feature in Linux requires you to press Shift-Alt-NumLock to activate the feature. For Roger's handicapped friend (who had one finger on one hand with which to manipulate a computer) this is an inexcusable and impossible situation. He couldn't possibly even activate the feature he needed to address his problem! Roger notes that the feature can be toggled in Windows with a single NumLock key.

Roger's friend has since passed away, so this is a bit late for him, but it occurs to me that the situation is still untenable for people in similar straits. Here's a solution:

First, some reference for other people looking for information on this or similar access issues. These features aren't a feature of Linux per se... they're features of the X windowing system that runs on many operating systems (mostly flavors of Unix). They're known collectively as accessX and are governed by xkb. I'm using Kubuntu 8.10 with the KDE desktop environment and Compiz effects enabled (watch it in action!), but this advice should work on just about any Unix.

If you never have to change the setting once it's enabled, then things are made easier by KDE. In Kubuntu 8.10, KDE4's session management restores your MouseKeys settings to whatever state you were last using. IOW, once it's been invoked it stays invoked even when you shut down the computer and reboot. You boot, log in (if you've not turned auto-login on), and you can immediately use the numeric keypad to control the mouse. There's no need to press any key combination to invoke MouseKeys. This is a per-user setting.

However, MouseKeys is a feature of X11, and it's configured globally, as are most things, by a text file.

In this case, the configs are in the directory /usr/share/X11/xkb/compat/. Having found them, I'm not surprised Roger didn't, as most Unix configs are in /etc/... On my computer, I have edited /usr/share/X11/xkb/compat/accessx (as root) and have replaced the line:
interpret MouseKeys_Enable {
action= LockControls(controls=MouseKeys);
};

to
interpret ScrollLock {
action= LockControls(controls=MouseKeys);
};
to use the ScrollLock button to toggle MouseKeys. You can use any unused key, including NumLock. This works at any time that I'm in an X GUI (not just in KDE4). You can modify the MouseKeys themselves (which key is mapped to which mouse action or button) by editing the file /usr/share/X11/xkb/compat/mousekeys.

This might look daunting, but it's not. In fact, once it's configured, there's no need to visit this file again. KDE4 makes even editing this one word largely unnecessary by assuming that accessX features should be restored to whatever state you last left them... an excellent assumption for people who need them all the time.

There are several "take-home messages" from this...
  1. In Linux, if you expressing a problem publicly is likely to get you a solution, as is the case here.
  2. Most problems can be solved without programming. This particular problem is solved with a text editor and information.
  3. If a thing can be done at all, it can be done in Linux.
A further take-home message is that the text files in Linux are not a disadvantage. They are your strength. They give you the ability to control and customize things that would be out of your reach under Windows without some program to tweak things for you. I recall when Windows 95 was still in pre-release that one of the goals of having a system registry was to get configuration text files such as system.ini out of the hands of users. It was too easy to tweak the system, and Microsoft saw that as a support issue. So now you have the Registry, and RegEdit, and interminably long hexadecimal keys that mean nothing to you. But I digress. Generally speaking, Microsoft has done an admirable job with accessibility.

Back on the subject of accessX, I've found that Kubuntu + Compiz has additional accessibility features that are big improvements over what Windows offers. For instance, you can use your "Super Key" (the one with the windows logo on it) + your mouse wheel to zoom into the desktop at any magnification. The mouse continues to work normally... it acts as if the desktop is full sized, and your monitor becomes a "window" through which you see a portion of that magnified desktop. As you move your mouse pointer, the desktop scrolls to keep the pointer visible.

Linux also implements Sticky Keys the same way Windows does... if you press the Shift key five times, a dialog box comes up asking if you want to activate the feature. Sticky Keys latches your modifier keys so that you can press "Alt", then "T" (for example) rather than the Alt-T combination. This sort of feature is tailor-made for those who share the physical limitation of Roger's friend.

There is an on-screen keyboard for those people who can only use the mouse.

There is now a text-to-speech interface for programs, to enable them to speak. It makes it pretty easy us programmers... it's up to us to use it. The GNOME desktop includes the Orca screen reader, which works pretty well with GNOME programs, even when they're running under KDE4. I'm listening to Firefox proofread this article as I type.

To date, the totally blind are still better off on Windows if a GUI is necessary. There are simply more programs available. But I would suspect that they're better off yet with a completely text-based interface, such as EMACS-speak ("the complete audio desktop"), a fully featured text-based interface in Linux. I'll leave that assessment for people better versed in the subject than I.

0 Comments:

Post a Comment

<< Home