Ake Koomsin

Remap CAPSLOCK to CTRL on FreeBSD

Assuming that you are using us.iso.kbd keymap, you can remap CAPSLOCK to CTRL by this simple following steps.

First, copy the us.iso.kbd

1
2
# cd /usr/share/syscons/keymaps/
# cp us.iso.kbd us.iso-swap.kbd

Next, modify the permission of us.iso-swap.kbd to be writable.

1
# chmod 644 us.iso-swap.kbd

Then, modify us.iso-swap.kbd. Look at the line with number 058 and change “clock” to “lctrl” like this.

1
2
3
...
058   lctrl  lctrl  lctrl  lctrl  lctrl  lctrl  lctrl  lctrl   O
...

After that, change the permission back to read-only

1
# chmod 444 us.iso-swap.kbd

Finally, add this text to /etc/rc.conf

1
keymap="us.iso-swap"

Reboot and now your CAPLOCKS will be CTRL.