Hacker News new | ask | show | jobs
by rakete 3192 days ago
Instead of mapping to Escape (or Control) I prefer mapping Caps Lock to ISO Level3 Shift, also known as AltGr. That way I get a whole new type of modifier that I can use to assign custom functionality to.

For example I map AltGr+j/k/l/i to the arrow keys so that I can navigate code without taking my fingers of the home row, regardless of the editor I am in. I also have AltGr+h mapped to Backspace, AltGr+m is delete, AltGr+u/o are home/end and so on and so forth. It opens up lots of possibilties.

1 comments

What keyboard do you use? There is already an AltGr key on most keyboards.
I haven't seen an AltGr key on a keyboard in the US in at least 15 years.
At the USB HID level, AltGr is merely the right Alt key; the interpretation is just host software.

If a keyboard physically has two keys labelled ‘Alt’ and two labelled ‘AltGr’, then at the protocol level both ‘Alt’s are (indistinguishably) USB LeftAlt and both ‘AltGr’s are USB RightAlt.

(Mac keyboards' ‘Option’ is the label for USB Alt and acts like Windows' AltGr.)

Apart from the label, AltGr is identical to right hand Alt. The difference is all in software. For example, if you tell your computer you have a UK keyboard it will treat right hand Alt as AltGr.
In Europe most PC shops still sell them.
German Keyboard. Yes, there is an AltGr key on my keyboard but I map that one to Control actually...

In fact I swap my Alt and Control keys, and don't use AltGr for its original intent at all, because using AltGr+7/8/9/0 on the German keyboard to type {[]} is horrible. I use an english layout (which I modified with my AltGr+j/k/l/i thing and a bunch of other tweaks) instead.