I have created a keyboard layout in the Microsoft Keyboard Layout Creator tool. It is based on US layout, the only changes I've made include:
mapped from mapped to
alt(right)+[ å
alt(right)+' ä
alt(right)+; ö
alt(right)+Shift+[ Å
alt(right)+Shift+' Ä
alt(right)+Shift+; Ö
The goal is to allow me to use the US layout but add the possibility to enter Swedish characters while holding the right alt key. This works to a degree, but feels buggy. When attempting to enter the Swedish characters using this custom map, nearly 1 out of every 3 attempts will send input incorrectly. Often, no character is input at all, and if retrying the same character, it is inserted after the cursor.
I've used it this way before on a Windows 10 system, where it worked perfectly. Now I'm on a Windows 7 Enterprise box where the problem occurs.
Update April 7:
This is not the same computer or keyboard as when I successfully used it with Windows 10, so it might not only be a difference between the versions of the operating systems. However, I am using the same hardware with GNU/Linux where I have a flawless configuration with the same key mappings, so I doubt it has to do with key ghosting. Also, I have tried with two very different keyboards, with the same result.
One observation is that the frequency of the misbehavior varies depending on the software used. For instance, in Google Chrome it happens very frequently. I can never type å (trying will even release focus on the input field), but the other characters only fail intermittently. Typing in a terminal or Notepad works better, but not without problems.
It feels like if something else was listening for the right alt key and competes with my layout setting. Of course, this is just a hypothesis.