As somewhat of a "keyboard enthusiast", I am occasionally forced to use a keyboard with an ANSI layout, which is clearly inferior to the ISO layout:
Furthermore, the ANSI (US) layout is missing the Swedish letters å, ä and ö. On this page, I collect various ways of solving these problems:
As an extra note, if you're not familiar with the Swedish/Finnish layout, here is a picture. Note the extra key next to the left Shift key, as well as the key placement around the Return key:
The most obvious approach is to start with the US layout and add the necessary Swedish letters to it.
One approach is to put these letters on the [{, ]} and \|
keys, relegating the original characters to a layer accessed by holding
Right Alt. This can be done using the following AutoHotkey code:
SC01A::å
SC01B::ä
SC02B::ö
+SC01A::Å
+SC01B::Ä
+SC02B::Ö
>!SC01A::SendInput, [
>!SC01B::SendInput, ]
>!SC02B::SendInput, \
>!+SC01A::SendInput, {{}
>!+SC01B::SendInput, {}}
>!+SC02B::SendInput, |
This method has two drawbacks:
On the other hand, å, ä and ö have not always been located at those positions. On typewriters, it is common to see them in a straight line to the right of the m key, where the comma, period and hyphen are located on the modern Swedish layout.
Furthermore, there are several great benefits of the above approach:
To me, the correspondence between the key cap legend and the typed character is very important, even though I touch type.
Added on 16 Dec 2021.
The problem with approach 1 is that the Swedish letters are very far away, especially the ö key. An alternative, more ergonomic approach is to use combinations of aa, ae and oe to type the corresponding Swedish letters.
One might use AutoHotkey's built-in "hotstrings" feature for this, but there are a number of issues with it. It is much better to implement the functionality yourself:
o::Combine("o", {})
+o::Combine("o", {})
e::Combine("e", {a: "ä", o: "ö"})
+e::Combine("e", {a: "ä", o: "ö"})
a::Combine("a", {a: "å"})
+a::Combine("a", {a: "å"})
`::Combine("``", {a: "à"})
'::Combine("'", {e: "é"})
Combine(original, keys){
global shiftPrev
shift := GetKeyState("CapsLock", "T") ? !GetKeyState("Shift")
: GetKeyState("Shift") or GetKeyState("CapsLock", "T")
for prior, replacement in keys
if(A_PriorKey == prior){
if(shiftPrev)
StringUpper, replacement, replacement
SendInput, {Shift Down}{Left}{Shift Up}%replacement%
goto done
}
if(shift)
StringUpper, original, original
SendInput, % original
done:
shiftPrev := shift ; May be used by next call.
}
Another approach is to use the Swedish/Finnish layout in the
operating system, with a couple of modifications. The following
AutoHotkey code represents a couple of such modifications:
§::<
½::>
<^>§::|
*<^>1::SendInput, §
*<^>!::SendInput, ½
¨::'
^::*
'::¨
<^>*::~
Here is a summary of the changes:
This approach has a couple of advantages:
However, it also has a significant disadvantage:
Last updated on 16 Dec 2021; before that on 21 Dec 2020.
© 2020–2021 John Ankarström. Up