Adding Finnish Alphabets to US Keyboard Layout

I don’t like Finnish keyboard layout that much. Way too many characters require three keys to be pressed simultaneously. This is especially annoying when programming, since to get, e.g., different types of brackets, you have to change between Alt Gr and Shift quite heavily. Furthermore, Finnish layout has keys like ‘¤’, which I have never used (and just recently learned that is used to denote an unspecified currency). Many common characters used in programming are dead keys, which makes them difficult to use. I haven’t ever used the dead key functionality in ‘`’, ‘~’ or ‘^’ and usually I try to use layout where that is disabled. In Linux, there is usually a variant of Finnish layout without dead keys, but not in Windows. To tackle these problems, I decided to try US layout.

I mostly write English, but sometimes I need Finnish and quite many words have ‘ä’ or ‘ö’. I don’t like switching between different layouts, because I often forget to change it back. One nice thing in a Finnish keyboard is that it has 105 keys, one more than the standard US keyboard. This extra key is located between left shift and ‘z’ and is bound to ‘<’ by default. In ArkkuDvorak, this key is used for ‘ä’ and ‘ö’, so I decided to create US layout with that addition. I don’t remember when I have needed those capitalized and I could manage those rare occasions with M-c.

Modifying keyboard layout in Windows requires Microsoft Keyboard Layout Creator which is quite straightforward to use. There you can load the US layout and change the extra key to whatever you want. You can find the source file for MKLC here or even the ready-made installer here.

In Linux this is even easier. With xmodmap you can modify your current X keyboard bindings. By doing xmodmap -pke > ~/.Xmodmap, you can dump your current layout to a file. Then just by applying the following patch you can get ‘ä’ (adiaeresis) and ‘ö’ (odiaeresis) to that extra key.

1
2
3
4
5
6
7
8
9
10
11
--- .Xmodmap_default_us 2015-01-25 12:47:18.212591435 +0200
+++ .Xmodmap 2015-01-18 21:34:26.435894329 +0200
@@ -84,7 +88,7 @@
 keycode  91 = KP_Delete KP_Decimal KP_Delete KP_Decimal
 keycode  92 = ISO_Level3_Shift NoSymbol ISO_Level3_Shift
 keycode  93 =
-keycode  94 = less greater less greater bar brokenbar bar
+keycode  94 = adiaeresis odiaeresis less greater bar brokenbar bar
 keycode  95 = F11 F11 F11 F11 F11 F11 XF86Switch_VT_11
 keycode  96 = F12 F12 F12 F12 F12 F12 XF86Switch_VT_12
 keycode  97 =

Xmodmap can be read by xmodmap ~/.Xmodmap (be careful though, you might want to test that it actually works by using some other filename). This is usually read automatically when X starts, but you can also add this to e.g. .xinitrc. While you are at it, you might want to make your caps lock act as a control by modifying the same file. For doing that on Windows, I have used this application.

Comments