I've seen some setxkbmap stuff when talking about key mappings, but ctrl-c isn't a single key.

Ideally, I would love to make it a copy/paste key but that seems impossible on Linux.

Is there a way on Gentoo/Arch Linux to remap the caps lock key into:

  • caps lock on = copy
  • caps lock off = paste

or just a "hitting the caps lock = ctrl+c" mapping?


There isn't a way to produce a keypress event based on the state of a locked key like that. There are a few reasons for that, but as a counter example, what happens if you copy something, then later want to copy something else without pasting? You select something in your editor, press Caps Lock, and rather than copying, which is your intent, it pastes the previously copied buffer, deleting your selected text. Hope you can undo!

I believe there's also no way in XKB to have a single keypress produce Ctrl-C, but there are a few tools to do just that.

Generally speaking, XKB works really well and is very versatile, but if you want something more custom than what it provides, it tends to make your life difficult. Or at least it used to, last time I tried.

  • One way to emulate the detection of states would be to keep the last state stored somewhere. – Chris Down May 28 '12 at 11:39
  • Which tools would you suggest to accomplish that? – sublimepua May 28 '12 at 19:37

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.