Skip to content

Latest commit

 

History

History
68 lines (45 loc) · 1.87 KB

crouton-caps-lock.md

File metadata and controls

68 lines (45 loc) · 1.87 KB

Map the Search key to Caps Lock in crouton

// crouton ubuntu chromebook chrome os, caps lock, linux

Crouton is a nice set of scripts for running Ubuntu on a Chromebook. These notebooks have a Search key in place of the usual Caps Lock key.

This article describes how to map the Search key to the Caps Lock function in crouton.

Determining the current keycode and keysym

In your chroot, start xev and press the Search key:

$ xev | grep keycode

If you haven't installed the keyboard target you should see

    state 0x0, keycode 133 (keysym 0xffeb, Super_L), same_screen YES,
    state 0x40, keycode 133 (keysym 0xffeb, Super_L), same_screen YES,

which means that the key has the keycode 133 and is associated to the keysym Super_L, which is the function triggered by the Windows key on other keyboards.

All we now need to do is to associate that same keycode to the Caps_Lock keysym.

Associating Caps_Lock keysym to keycode 133.

You can do so by typing

$ xmodmap -e "keycode 133 = Caps_Lock"

You can now add this line to any autostart script you have in place. Note that this command must be issued after any setxkbmap command otherwise it will be overriden.

For the record here is the usual way.

Performing association on X server's start

Create a file ~/.Xmodmap containing:

keycode 133 = Caps_Lock

Add the following lines to your .xinitrc:

if [-s ~/.Xmodmap]; then
    xmodmap ~/.Xmodmap
fi

Remapping to Escape (for vim users)

Replace Caps_Lock with Escape:

$ xmodmap -e "keycode 133 = Escape"