Annoying AltGr and right-hand side characters

One very annoying aspect of the Swedish / Finnish ISO keyboard layout through the eyes of a programmer trying to avoid Repetitive strain injury (RSI), is the placement of the square and curly brackets symbols. For example, in order to produce the character {, you need to perform a finger gymnastic maneuver in which your thumb holds on to the AltGr button (to the immediate right of the space bar) whilst your middle finger stretches to find and actuate the key producing number 7. At least this is the least painful way I know of. The same sort of troublesome combinations are required for the symbols [, ] and }.

On Windows, you can emulate AltGr by holding Ctrl + Alt with the fingers of your left hand while your right hand's fingers are less restrained and can easily reach numbers 7 through 0. Unfortunately on my preferred OS, which is of course Linux, Ctrl + Alt is pretty much reserved for shortcuts like locking the screen with Ctrl + Alt + L and Ctrl + Alt + Del for restarting the X server.

While searching around for ways to rebind Ctrl + Alt to AltGr I found vague responses on how it could be done as well as strong suggestions not to do it as it may cause problems with shortcuts down the road. However, I couldn't give up just yet, as I found the placement of these bracket characters extremely irritating — maybe a bit too much than anyone really should.

A compromise I came up with is to rebind the symbol §, a character used once in a blue moon, to something more useful — you guessed it, AltGr. The odd § character can be found in the far upper-left corner of the ISO layout, to the immediate left of number 1. While this far from perfect, with § laying far away from the home row, it still beats having to stretch my right hand into bizarre, unruly positions.

The binding can be put into effect by appending the following contents into your ~/.Xmodmap file. After the file has been saved , a re-login should suffice to bring the bindings into effect.

! §-button remapping
keycode 49 = ISO_Level3_Shift

I'm not overjoyed by this compromise, I'd still prefer something simpler. Nonetheless, it is one small step against the hell I call AltGr.

  • keyboard
  • ergonomics