Can I change the Caps Lock key to Control and still keep the on/off nature of Caps Lock? I've checked into using xmodmap and seem to have hit a dead end. Many people want to swap them, but they also want to swap the way they work. I'd rather keep my new Control key as an on/off switch for Control.
There's no low-level support for a Ctrl Lock in either Linux or Xorg outside of bugs, so you'll either need software that will feed the Ctrl press back into some input buffer in order to simulate a lock, or you'll need a keyboard that supports it directly.
First, strip Caps Lock of its special functionality using xmodmap (this has to be done each time X is started):
Then, add the following bindings to you
This creates a fake keypress (without release) of the Ctrl key whenever Caps Lock (now F13) is pressed. The up+down sequence is there for some technical reasons of how the fake events work.
In this version, pressing (left) Ctrl releases the lock. This could be modified (either so that both controls release it, or neither does) but it would be a little more complicated (e.g. one could create another control key (e.g. F14) and fake-press that instead of Control_L).