Revision 12 as of 2006-04-24 19:58:48

Clear message

Acessibility Information for the Mobility Impaired

A quick guide to window manager independent and command line accessibility in Ubuntu for people who have difficulty using the standard keyboard and mouse devices.


About me, the author: My profession is software developer and I am a person with mobility impaired disability. About 1,5 years ago, I changed from Windows to Linux. As a result of my disability, I needed special settings for my keyboard and mouse/trackball. Without the linux experience of a friend, it would have been hardly possible to configure these settings.

The following article is just a hint for advanced users, having the same problem.

Stickykey on the console

To enable stickykeys on the console, you need loadkeys. It is a program to manipulate key mappings and should be available on each base system.

1. Step: Create a file eg. ~/.loadkeys with the following content: {{{keymaps 0-15 keycode 29 = SCtrl keycode 42 = SShift keycode 54 = SShift keycode 56 = SAlt keycode 97 = SCtrl keycode 100 = SAltGr }}} 2. Step: Call loadkeys /home/thilo/.loadkeys. Hint: Can only be done by root!!!

Now, all modifier keys of the keyboard work with stickykeys.

In the [#example Configuration example] below you see a setup for daily usage.

For further information refer to:

Stickykey on the X server

Because of the missing tool 'xorgcfg' or 'xf86cfg' [] in the ubuntu repository, you have to use the commandline tool 'xkbset'. Which isn't very user-friendly. You have to call 'xkbset' twice. By the first call, you set the expiry of the accessx settings. This is necessary, because there is a default timeout. By the second call, you can adjust the accessx settings themself. I don't know why, but in my settings, this was the required order!

With xkbset -h you will get a help message.

An example for setting the expiry of the accessx settings:      xkbset exp -bell -sticky -twokey -latchlock -accessx -feedback -stickybeep -led

You have to disable the expiry of all accessx settings you need. Because, if you set an explicit timeout with '0', you will cause a xorg runtime error.

An example for adjust the accessx settings:      xkbset bell sticky -twokey latchlock feedback led stickybeep

For further information refer to:

In the [#example Configuration example] below you see a setup for daily usage.

Configuration of a mouse/trackball on the X server

The first tricky bit for me was to find out the correct settings for the 'InputDevice' section of the /etc/X11/xorg.conf. I had to google a lot and had to try some protocols to find out which one supports all the buttons of my kensington usb trackball. Lets have a look at the 'InputDevice' section of my xorg.conf:

{{{Section "InputDevice"

  • Identifier "Configured Mouse" Driver "mouse" Option "Device" "/dev/input/mice" Option "Protocol" "ExplorerPS/2" Option "Buttons" "6" Option "ZAxisMapping" "5 6"

    Option "Emulate3Buttons" "no" Option "DragLockButtons" "1 4"

EndSection }}} Some hints:

  • 'Buttons': The correct number is the number of your mouse buttons plus two, if you have a wheel.
  • 'ZAxisMapping': The buttons used for scrolling. (The movement of the wheel is mapped to buttons.)

  • 'DragLockButtons': This is the setting for 'Drag and Drop'. In this example, button 4 is used to lock button 1. If you press button 4, button 1 is locked. If you press button 4 again, button 1 is released.

For further information refer to:

The second tricky bit was to find out how to change the default button layout of my trackball, which wasn't very usefull to me. With the commandline tool xmodmap, you can change the layout of the buttons. For example, if you would have a mouse with 3 buttons, the following command would swap the left button with the right one.

     xmodmap -e "pointer = 3 2 1"

For further information refere to:

To justify the acceleration and threshold, use the commandline tool 'xset'. For example:

     xset m 7/10 2 This reduces the mouse acceleration to 0.7 and sets a threshold to 2

For further information refere to:

As you can see, the configuration of a mouse/trackball with many buttons isn't very easy. A tool that displays the keycodes of the mouse and the keyboard is 'xev'. You can use it to check the layout of the buttons.

It is not easy to find the required mouse/trackball settings, especially if you need another button layout than the default one.

In the [#example Configuration example] below you see a setup for daily usage.


Configuration example


To activate the loadkeys settings on each console login, I've added the following line to /etc/rc.local:       loadkeys /home/thilo/.loadkeys > /dev/null

X server

Ok, now lets see how to setup the things above, so that they are called on each start of the X server. I've written a shell script, which contains all necessary tool calls. For example:

# setting the expiry of the accessx settings
/usr/bin/xkbset exp -bell -sticky -twokey -latchlock -accessx -feedback -stickybeep -led

# stickykey settings
/usr/bin/xkbset bell sticky -twokey latchlock feedback led stickybeep 

# layout of the mouse buttons
/usr/bin/xmodmap -e "pointer = 2 3 6 1 4 5"

# mouse acceleration and threshold
/usr/bin/xset m 7/10 2

Now create a link from this stript to /etc/X11/Xsession.d, for example /etc/X11/Xsession.d/91xinit. The script starts now before the X server. Beware: The link shouldn't have any extention.

thilo DateTime(2006-03-16T12:39:00Z)