Google PlusFacebookTwitter

Enabling Sticky Keys in Ubuntu

By on Jan 15, 2009 in Tech Takes | 15 comments

Share On GoogleShare On FacebookShare On Twitter

Support for Sticky Keys in Ubuntu has been quite sketchy for the past few releases. For the uninitiated, Sticky Keys allows you to hit the Ctrl / Shift keys with their letter combination without having to press them down together. (This is available in Windows too; hit Shift key five times in a row to bring up the necessary dialog box.)

I prefer to use Sticky Keys a lot. It makes typing faster and more accurate (when it comes to capitalization). That’s why I’m kinda partial to KDE-based distros: apart from the interface with lots of eye-candy, KDE’s implementation of accessibility features works. This is not true with GNOME, where there seems to be a bug in at-spi (the Assistive Technology Service Provider). I’ve already filed a bug report for this issue in Launchpad for Ubuntu. For a distro which keeps a separate page on accessibility (shows the Sticky Kets feature there too), it is ironic that this bug has remained for such a long time at ‘Low’ priority.

Anyway, a few days back I figured out how to fix this problem. I was browsing through keys in gconf-editor when I came across the accessibility-related values. Here’s how you can enable Sticky Keys in Ubuntu.

  1. Go to System Tools > Configuration Editor. If it is not enabled, you may need to edit your Main Menu to show this item by going to System > Preferences > Main Menu and doing the necessary edits. You can also launch gconf-editor using the terminal.
  2. In Configuration Editor, go to /desktop/gnome/accessibility/keyboard. Check the box stickykeys_enable. Uncheck the boxes next to stickykeys_modifier_beep and stickykeys_two_key_off. (It’s the second one which you MUST turn off.) Do this step before the next. (Don’t change the order.) If timeout_enable is checked, uncheck it.
  3. Double-click on the timeout field value and change it to some high value like 7200.
  4. Close Configuration Editor without making any more edits. If you change any other value, or open gconf-editor any day later then note that your ‘timeout’ value will be reset to default of 120 seconds.

Methinks the issue (of Sticky Keys) getting switched off every once in a while is because the stickykeys_two_key_off value is enabled even when it has been disabled from Preferences > Keyboard. Moreover, the reset of timeout value is also not expected behavior and is probably a bug too.

Hope this solves the issues for anyone else who wants to use Sticky Keys in Ubuntu (or any other GNOME-using distro)!



15 Comments

  1. Aditya

    January 15, 2009

    Post a Reply

    Are Feedburner/Google Reader really screwed up, or did you actually post this at 5 in the morning?

    If you wish, I can provide visual confirmation.

    • Ankur

      January 16, 2009

      Post a Reply

      No, I posted this somewhere around 11pm on 14th. Maybe Google feedfetcher bot accessed it later – but even then, it should be taking post time from the XML data and not making its own assumptions.

      (But it does screw up feed post time. Add any new feed in Google Reader and it will show current time instead of feed post time.)

  2. Prashanth Kanduri

    January 19, 2009

    Post a Reply

    Hehehe,
    So you turned into a Windows Vista user just for this huh? Its best when you don’t get used to such habits which aren’t feasible everywhere. Like if you are addicted to drinking Brazillian Leaf-Gensing flavored tea, you can’t really have anything in Lakshadweep at all!
    I hope you get the point. Maybe it speeds up typing a lot, but then I am pretty sure many normal PC users can type much faster than you without even the use of sticky keys. Now you were so hell bent stubborn to use it that you changed your bloody OS to Windows Vista of all things in the world.
    You were actually just a few steps away from actually starting to appreciate it… My goodness! On the larger side, it seems like a really small reason to chuck a wonderful desktop environment like that you know!
    And also writing blasted reviews of a pretty nice release by the Ubuntu guys…
    PS: What plugin do you use for the reply-to-comment thingy?

    • Ankur

      January 20, 2009

      Post a Reply

      Even I can type faster if I didn’t bother with capitalization. My point is that if someone is OK with all lowercase, then of course he’ll write faster than me. If, however, like me someone wants to meticulously uses proper caps, then Sticky Keys is heaven-send. Most people simply don’t know about this feature, which is why they don’t use it. You know what Nandakumar does? When he needs to do caps, he hits Caps Lock key, the alphabet he wants, and then Cap Lock key again to turn it off. (Mac OS X probably doesn’t have Sticky Keys. Poor chap. I feel sorry for him.)

      As I said, for a distro which touts itself as ‘the most accessible’ and has a separate page on it, it is surprising that the bug related to this has been given a ‘low’ priority and hasn’t even been assigned to anyone.

      The reply-to-comment thing is a built-in feature of WordPress 2.7 – you don’t need any separate plugin for that. What you do need is a WP 2.7 compliant theme which supports displaying threaded comments like these. Themes which don’t support this feature just show the comment in chronological order.

      • Prashanth Kanduri

        January 20, 2009

        I wonder why Nandu wants to sound funny on Twitter! Plus, it looked like a public message. He really wanted to share this with everyone?!
        Many people, out of ignorance or out of practice don’t use Sticky Keys even if they need to take casing into account (and still type faster than you do). It might be convienient, but then touting it as the major reason to abandon Linux and convert into a Windows user caused diarrhea due to indigestion in my tummy!
        PS: Must appreciate your recollection power! You are the right man for putting in the reference links for making TQ sites! :) BTW, interested this time?
        PSS: Me not finding any nice dark 2.7 complaint themes! :(

      • Ankur

        January 20, 2009

        He was dead earnest on Twitter. And Twitter is completely public. :|
        I can type pretty fast. And accurate. I just can’t handle keyboards which give a strong tactile feedback – which most of them do (like yours).
        OK, whatever I might have used for a while, I can say that Ubuntu is better than Windows Vista. Mostly, it was laziness about having to shift all of my data from NTFS to Ext3. I know I can access an NTFS drive and automount it, but I hate the folder structure of NTFS when you need to access from Linux. And all hidden files and folders cluttering up folder view – and you can’t even hide them with .hiding thing because then it would screw up links in Windows. I’m personally don’t like dual-booting since I know I’ll use only ONE of the OSes, and the other one wasting space would irritate me. So there. :)
        You can check out WordPress’ own theme gallery. Rather, you should check out WordPress 2.7 compatible theme list, and see if there’s any dark theme you like.

      • Ankur

        January 20, 2009

        Oh, and no, I don’t will be able to do TQ this time.
        a) We don’t have enough people. Mishraji, Lord Vader, Tech Nut, you – all will be busy with exams and / or entrance exams. And none of your parents are as cool with tomfoolery during exams as mine are. :P
        b) We don’t have time to come up with an idea, discuss it, research it, implement it. Last time we might have started work later but we’d discussed it earlier and were well-versed with the topic.

      • Ian MacEwan

        March 10, 2014

        Thanks for the post. I am disabled enough to absolutely need “sticky keys” on any computer I use, and I will choose an OS based on how well it handles it. I am currently using Windows XP in preference to Windows 7 because those settings in XP would persist after reboot, and in 7 would not. Now, I have to find another OS that will behave as well as XP. A Linux distro would mean I can continue to use the same hardware (single Intel dual-core Pentium D, with 2 GB of RAM.) I don’t know how well sticky keys persist in Win 8. Sticky Keys is an option in Mac OS X, and, like XP, shows which keys are “stuck” on screen. OS X shows a dimmed image of the symbol for the key, and XP shows key status on the Taskbar. If I can’t find a distro that will do as well, I’ll have to spend money on a Mac. By reputation, their settings persist even better than XP.

  3. John Baber

    January 29, 2010

    Post a Reply

    If you can figure out how to set sticky keys in general for window managers other than gnome and kde (e.g. the extremely accessible Ratpoison), you’ll be my hero.

    xkbset doesn’t set sticky keys in the latest Ubuntu (even though it’ll set other things like mouse emulation) and the author himself can’t figure out why.

    • Ankur

      January 29, 2010

      Post a Reply

      I faced this problem when using Xfce too. I don’t get why devs don’t pay attention to this, since this is an accessibility feature and it’s clearly broken.

Submit a Comment

Your email address will not be published. Required fields are marked *