[Novalug] Reconfiguring your keyboard: [was: Re: [Opinion] The age of "Guilt-By-Knowledge" and how the anti-system crowd has "won"]

Rich Kulawiec rsk@gsp.org
Thu Apr 30 13:49:40 EDT 2015


On Thu, Apr 30, 2015 at 12:24:35PM -0400, Bonnie Dalzell via Novalug wrote:
> It is configurable. The problem is where is it configurable?

Meet xmodmap: the command so good that you only have to run it once.

Xmodmap is designed to allow you to remap your keyboard (and mouse
buttons) to what you'd like them to be.  I agree that the CAPS LOCK
KEY IS A DAMN NUISANCE and I do wish that it'd be consigned to the
dustbin of history.

So anyway, in my ~/.xmodmap file:

	!
	! Swap Caps_Lock and Control_L
	!
	remove Lock = Caps_Lock
	remove Control = Control_L
	keysym Control_L = Caps_Lock
	keysym Caps_Lock = Control_L
	add Lock = Caps_Lock
	add Control = Control_L

In this context, Control_L is "the control key on the left side of
the keyboard" -- I have one on the right as well, but it is unaffected
by this.  That sequence above removes the default mapping between
the physical keys and their functions, then creates a new mapping
that is sensible for 'nix people.

Usage:

	xmodmap ~/.xmodmap

You can do all kinds of things with xmodmap.  I tend to remap the
Tab key to Escape because I use vi (unlike the infidels who use emacs)
and the escape key comes into play often.  I've also remapped Backspace
to the tilde character because I use Control-H as erase, thus I don't
need backspace, but I do need tilde quite often.  And so on: salt to taste.

One of the fun side effects of this is that on those extremely
rare occasions when I have someone else type on my keyboard,
they can't do a darn thing. ;)

---rsk



More information about the Novalug mailing list