I have a Danish keyboard, but I find the English keyboard layout better to code with, so some time ago, I made some customizations using xmodmap to combine these. I wanted to use the English layout in general, but with the Danish characters æ, ø, and Ã¥ available using Alt Gr-;, Alt Gr-’ and Alt Gr-[, respectively. Also, I wanted to be able to use Alt Gr as a modifier for FVWM shortcuts.
This turned out to be tricky to accomplish, actually. If I set XkbLayout=us in xorg.conf (English layout), I couldn’t get Alt Gr to work with the Danish Characters and as a modifier key at the same time. Mode_Switch or ISO_Level3_Shift either switched keycodes or acted as a modifier key, but not both. Even if I restored the previous Danish layout using dumps of keycodes and modifiers from xmodmap, it didn’t work.
So I made a hack: continue reading…