Wednesday, July 7, 2010

Orca Caps Lock Issue

Caps Lock key doesn't work is the most common complaint from Orca screen readers users. On Ubuntu 10.04 Lucid Lynx I found that Caps Lock is reset mysteriously. Here is workaround you can use until we find the culprit responsible for this.

Debugging with xmodmap

You find the present keymaps setting with xmodmap command. You can see that the line starting 'lock' is empty. We can set it properly with xmodmap -e "add Lock = Caps_Lock".


$ xmodmap 
xmodmap:  up to 4 keys per modifier, (keycodes in parentheses):

shift       Shift_L (0x32),  Shift_R (0x3e)
lock      
control     Control_L (0x25),  Control_R (0x69)
mod1        Alt_L (0x40),  Alt_R (0x6c),  Meta_L (0xcd)
mod2        Num_Lock (0x4d)
mod3      
mod4        Super_L (0x85),  Super_R (0x86),  Super_L (0xce),  Hyper_L (0xcf)
mod5        ISO_Level3_Shift (0x5c),  Mode_switch (0xcb)

# Set the Caps_Lock with xmodmap 
$ xmodmap -e "add Lock = Caps_Lock"

# Now caps lock works properly
$ xmodmap 
xmodmap:  up to 4 keys per modifier, (keycodes in parentheses):

shift       Shift_L (0x32),  Shift_R (0x3e)
lock        Caps_Lock (0x42)
control     Control_L (0x25),  Control_R (0x69)
mod1        Alt_L (0x40),  Alt_R (0x6c),  Meta_L (0xcd)
mod2        Num_Lock (0x4d)
mod3      
mod4        Super_L (0x85),  Super_R (0x86),  Super_L (0xce),  Hyper_L (0xcf)
mod5        ISO_Level3_Shift (0x5c),  Mode_switch (0xcb)

Bash Autostart script for setting Caps lock

Now we know that this can be fixed so I used a bash script to call the modmap script everytime we boot. Somehow '.Xmodmap' settings are not getting loaded so I am using an alternative script '.xmodmaprc' and call it from .bashrc file manually. # .xmodmaprc xmodmap -e "add Lock = Caps_Lock" # .bashrc if [ -f ~/.xmodmaprc ]; then . ~/.xmodmaprc fi

Reboot the computer and enable the modmap file to be loaded at boot time. Enable Modmap load at book dialog PS: Kudos to dotslashblog for the xmodmaprc solution

No comments:

Post a Comment

You can leave a comment here using your Google account, OpenID or as an anonymous user.

Popular Posts