2

After watching some videos about tmux and vim collaboration I wanna remap Caps Lock on my ubuntu.

Remapping Caps Lock to Esc is easy I used gnome-tweak-tool, but now I wanna change Caps Lock behavior to work as Esc and Ctrl in some situations.

When I use only Caps Lock it works like Esc. When I use Caps Lock with some other key it works like Ctrl +something. How do I do that?

1
  • I really doubt that it can be done without rewriting the X keyboard interface. I personally have remapped Caps to Esc, and Esc to Ctrl. Sep 19, 2015 at 16:07

3 Answers 3

0

You can achive that using xmodmap. Please find the documentation here or ArchWiki https://wiki.archlinux.org/index.php/Xmodmap

Be careful though, sometimes a few portion is only Arch related.

Alternatively you can use two different shortcuts CAPS+ and CTRL+ to execute same commands in Menu > Keyboard > Shortcuts

0

Gnome Tweak Tools Update In the new Gnome Tweak Tools, there is an option to swap the Esc key and the Caps lock key. It's located under the Keyboard and Mouse tab, and the Additional Layouts Button. This is on Ubuntu 18.04

0

Yes, you can use the remapper deamon keyd for this purpose. See this answer for installation, usage and tips.

After installation, use this config (cf. the keyd Quickstart):

[ids]

*

[main]

# Maps capslock to escape when pressed and control when held.
capslock = overload(control, esc)

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .