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);

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.

Sunday, February 01, 2009

While you weren't looking, Linux got great.

I had an older Windows box that needed to be re-installed. (It's an HP Optiplex). Now, this isn't a crap machine. It's a 2.2GHz processor with a very decent video card. But it didn't come to me with a restore disk, so I called Dell to get one. Sadly, they couldn't hep me out because it originally shipped with Windows 2000. The restore disks are no longer being manufactured. They couldn't send a WinXP disk because that's not what it shipped with. So, it was either buy a new copy of Vista or put Linux on the box.

Kubuntu to the rescue. Not a big deal, really. Accelerated graphics is the only thing I generally have an issue with. Since the video card is Nvidia, there's superb support for it.

The thing that makes this post-worthy is that once I got Kubuntu installed it was time to install the apps. First, the Linux apps; here are my preferences:
  • OpenOffice.org (word processor, spreadsheet, presentations, database, drawing, math)
  • FireFox (web browser)
  • The GIMP (raster graphics, like Photoshop)
  • Inkscape (excellent SVG vector graphics editor)
  • Scribus (publishing)
  • Filezilla (FTP client)
  • GNUCash (finance)
  • KompoZer (web page authoring)
  • VNC (remote support)
  • Pidgin (multi-service instant messaging... not really necessary, but I like it better than Kopete, which is installed by default)
All of these were as easy as going to "Add/Remove Programs" and checking the boxes next to each program. Linux's "Add/Remove Programs" feature differs from Windows' in that Linux's actually adds programs. I didn't have to go searching, downloading, or running setup wizards for any of them. And actually, VNC wasn't necessary at all... the krdc (Remote Desktop) client that ships with Kubuntu also connects to vnc servers). The other thing you'll see missing from the list is email and calendaring. These are aptly provided by KDE, so Outlook need not apply. Installing, configuring, and updating Vista is not nearly as easy to use for the casual user; and that's saying a lot, because the Vista install is by far Microsoft's best effort to date.

I also installed the updated Nvidia drivers and the Nvidia X server (which is the foundation for the desktop) to improve performance. Again, this was done by checking boxes in "Add/Remove Programs". The video driver updates required me to reload the X server. This can be done without rebooting.

I also have a Palm TX. No worries, Add/Remove Programs provides kPilot for hotsyncing.

Now here's the one thing that's a little sketchy... YouTube videos require Flash/Shockwave, and the Linux Flash plugin from Adobe is really, REALLY bad. I mean, they didn't even give it more than the most superfluous stab. It's jerky, it's slow, it's not worth the effort. Fortunately Mplayer does a superior job of playing YouTube videos, and it's got a Mozilla plug-in that works just fine with Firefox on Linux. I installed that instead.

OK, so that's fine. Now I'd normally stop here, but I program, and need Lotus Notes. That's fine, there's a Linux client for that. But my customers are on Windows, and I need to make sure that my development environment is similar to their production environment. So another checkbox in Add/Remove Programs, and I've got WINE. This allows me to run Windows programs, including Notes. So I test out Wine with Everest (which thinks I'm running Windows XP Professional), and restore my Notes from backup.

So I've got a bunch of Linux programs and one Windows copy of Notes that could really be replaced with a Linux program if I weren't doing work for other people. So now it's time to do an inventory of the Windows-only programs I'm missing, and I find that there are... none.

Really. There's nothing I need. Even the games I play (and I'm not a big gamer) are available on Linux. Here are the games I regularly played on Windows.
  • Frets on Fire
  • SuperTuxKart
  • BZFlag
  • kNetwalk (I love this)
  • Frozen Bubble
  • Battle for Wesnoth
  • various games on ScummVM
  • various MAME games
  • OpenArena
  • FreeCiv
  • Risk (Domination)
ALL of these run on Linux, and most of the others that I play. the only game I play that doesn't run on Linux is Luxor, and there's a similar game that comes with the KDE desktop. And for the occasional Windows-only program that I might run across, there's WINE. They've made WINE nearly too easy... you install it, and simply run your Windows programs as if you were running on Windows. there's a folder on Linux that your Windows programs will think is the C: drive. That's it. When your Windows program looks for a default browser, it's your Linux browser that will start. You also have access to all of your Linux filesystem, so there's none of this being stuck in the emulated drive nonsense. You install Windows programs with their own Setup.exe programs, as normal, and they install themselves, complete with links in your application menu (under the WINE folder, of course).

So here's the deal... I don't need Windows. In my private usage I've weaned myself off of all Microsoft apps ages ago, and the OS is irrelevant when the apps are cross-platform. You probably don't need Windows, either. People keep arguing over whether this or that year is "the year of Linux on the desktop", and the fact of the matter is that it quietly came. Like Christmas in Whoville it came just the same. This isn't to say that it's going to immediately grab major marketshare... but you would never argue that Apple isn't "ready for the desktop" simply because few people use it or because not every Windows program runs on it. It's ready and it's great, and exactly the same is true of Linux.

For price, functionality, and stability, the arguments run 100% in favor of Linux. The only issue left for Windows fanatics is gaming. If you're a hardcore Windows gamer, more power to you, but you'd get a better gaming experience if you simply bought an Xbox. Consoles are for games, and the only issue in favor of Windows is dead.

Keep in mind here that I'm not saying that if you want Windows you should buy it. Buy whatever you like. What I'm saying is that there is no need for Windows... a very different thing entirely. I expect that people will go on offering long-obsolete arguments about Linux's unsuitability for home use because it doesn't have drivers for the device that prints witty sayings on their toilet paper, or some other such improbable thing... what they're doing is rationalizing the irrational. And to put that in perspective, I'll leave you with this lovely quote from Andy Rooney:
Computers make it easier to do a lot of things, but most of the things they make it easier to do don't need to be done.

Andy Rooney (1919 - )