Take the 2-minute tour ×
Ask Ubuntu is a question and answer site for Ubuntu users and developers. It's 100% free, no registration required.

I'd like turning sticky keys on and off to be done from a script. This is especially helpful to those not using kde/gnome/xfce.

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

This script works:

$ cat $HOME/bin/sticky_keys 
xkbset exp -bell -sticky -twokey -latchlock -accessx -feedback -stickybeep -led 9999
xkbset bell sticky -twokey -latchlock feedback led stickybeep

(If you would prefer pressing Shift twice to mean "hold down shift" then change '-latchlock' above to 'latchlock')

For more and related information, you probably will like this wiki page:

https://wiki.ubuntu.com/Accessibility/doc/Guide/Mobility

Because of the missing tool 'xorgcfg' or 'xf86cfg' https://launchpad.net/distros/ubuntu/+ticket/506 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: http://www.xfree86.org/current/xset.1.html

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

share|improve this answer
    
Please see if you can help out here: ubuntuforums.org/… –  user25656 Mar 26 '13 at 4:51
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.