karabiner

How do make karabiner type Ä?


I'm trying to map å (option-a) to ä (option-u, a) and Å (option-shift-a) to Ä (option-u, shift-a). I was able to figure out the first one:

{
    "description": "German: å to ä",
    "manipulators": [
        {
            "from": {
                "key_code": "a",
                "modifiers": {
                    "mandatory": [
                        "option"
                    ],
                    "optional": [
                        "any"
                    ]
                }
            },
            "to": [
                {
                    "key_code": "u",
                    "modifiers": ["left_option"]
                },
                {
                    "key_code": "a"
                }
            ],
            "type": "basic"
        },
    ]
}

but I'm having trouble figuring out the second one. If I hold down shift, I end up with ¨A, not Ä.


Solution

  • Use Karabiner-EventViewer or Apple's Keyboard Viewer while doing it manually to see shift-option-u gets a bare ¨, option-u a gets ä and option-u shift-a gets Ä so was:

    {"title": "German: å to ä",
     "rules": [{"description": "⌥a to ä and ⇧⌥A to Ä.",
            "manipulators": [
              {"from": {"key_code": "a", "modifiers": {"mandatory": ["option"],
                                   "optional": ["caps_lock", "control", "command"]}},
               "to": [{"key_code": "u", "modifiers": ["option"]},
                  {"key_code": "a"}],
               "type": "basic"},
              {"from": {"key_code": "a", "modifiers": {"mandatory": ["option", "shift"],
                                   "optional": ["caps_lock", "control", "command"]}},
               "to": [{"key_code": "u", "modifiers": ["option"]},
                  {"key_code": "a", "modifiers": ["shift"]}],
               "type": "basic"}]}]}