# Mapping International Characters

**URL:** <https://community.keyboard.io/t/mapping-international-characters/556>\
**Category:** Help and Getting Started\
**Created:** [October 26, 2017, 7:56pm UTC](https://community.keyboard.io/t/mapping-international-characters/556 "2017-10-26T19:56:21Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![lasse](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/lasse/32/185_2.png) [@lasse](https://community.keyboard.io/u/lasse)\
**Post date:** [October 26, 2017, 7:56pm UTC](https://community.keyboard.io/t/mapping-international-characters/556/1 "2017-10-26T19:56:21Z")

</div>

How do I add characters like æøå/ÆØÅ and the euro sign to my keyboard layout?

I’d like to keep the US layout and hit those with fn and fn + shift combinations.

---

<div class="post-metadata">

**Author:** ![james.nvc](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/james.nvc/32/54_2.png) [@james.nvc](https://community.keyboard.io/u/james.nvc)\
**Post date:** [October 26, 2017, 8:01pm UTC](https://community.keyboard.io/t/mapping-international-characters/556/2 "2017-10-26T20:01:45Z")

</div>

There may be easier ways of doing this, but I’m using macros that use the Unicode plugin to write special characters: [https://bitbucket.org/jamesnvc/keyboardiolayout/src/92ffe67008df08c8afb70424c252f3318198541c/james\_layout.ino?at=master&fileviewer=file-view-default#james\_layout.ino-76](https://bitbucket.org/jamesnvc/keyboardiolayout/src/92ffe67008df08c8afb70424c252f3318198541c/james_layout.ino?at=master&fileviewer=file-view-default#james_layout.ino-76)

---

<div class="post-metadata">

**Author:** ![jesse](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/jesse/32/361_2.png) [@jesse](https://community.keyboard.io/u/jesse)\
**Post date:** [October 26, 2017, 8:05pm UTC](https://community.keyboard.io/t/mapping-international-characters/556/3 "2017-10-26T20:05:23Z")

</div>

@algernon is the domain expert here.

[https://github.com/algernon/Model01-sketch/blob/master/src/keymap.h](https://github.com/algernon/Model01-sketch/blob/master/src/keymap.h) and  
[https://github.com/algernon/Kaleidoscope-LangPack-Hungarian](https://github.com/algernon/Kaleidoscope-LangPack-Hungarian)

may get you started.

If you’re willing and able, it’d be super helpful if you can share what you learn here or on the wiki, so we can turn it into a proper tutorial.

---

<div class="post-metadata">

**Author:** ![algernon](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/algernon/32/4404_2.png) [@algernon](https://community.keyboard.io/u/algernon)\
**Post date:** [October 26, 2017, 8:21pm UTC](https://community.keyboard.io/t/mapping-international-characters/556/4 "2017-10-26T20:21:34Z")

</div>

The quick summary of things is this: if your keyboard is set to US-QWERTY, you will need some kind of OS-side assistance to input international characters. This can be a `Compose` key (as used in `LangPack-Hungarian` linked above), or you can use the `Unicode` plugin, also mentioned above. Both will need a bit of tweaking on the OS side, to enable either the `Compose` key, or `Unicode` input. But all major operating systems support both of these, it is up to you which one you prefer.

---

<div class="post-metadata">

**Author:** ![lasse](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/lasse/32/185_2.png) [@lasse](https://community.keyboard.io/u/lasse)\
**Post date:** [October 26, 2017, 8:45pm UTC](https://community.keyboard.io/t/mapping-international-characters/556/5 "2017-10-26T20:45:31Z")

</div>

Wow. I never heard about the compose key before! So damn cool!

> **[Compose key](https://en.wikipedia.org/wiki/Compose_key)**
>
> A compose key (sometimes called multi key) is a key on a computer keyboard that indicates that the following (usually 2 or more) keystrokes trigger the insertion of an alternate character, typically a precomposed character or a symbol.
> For instance, typing Compose followed by ~ and then n will insert ñ.
> Compose keys are most popular on Linux and other systems using the X Window System, but software exists to implement them on Windows and macOS.
> The Compose Character key was introduced by engin...

However it is not implemented on windows out of the box, so that makes it a bad option for me, since I work as a consultant and can often not install software on my pc.

The unicode plugin seems to be a little easier and I think it will work out of the box on windows and linux. On mac it requires changing the Keyboard Input Source to unicode input.

In some distant future it would be cool, if the compose key could be built into the firmware - on top of the unicode plugin 🙂

Anyways - I am going to try my luck with the unicode plugin.  
I will be back with how it goes - but it might take a few days before I have the time for it.

---

<div class="post-metadata">

**Author:** ![andrewg](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/andrewg/32/43_2.png) [@andrewg](https://community.keyboard.io/u/andrewg)\
**Post date:** [October 27, 2017, 12:33am UTC](https://community.keyboard.io/t/mapping-international-characters/556/6 "2017-10-27T00:33:17Z")

</div>

The alternative is to use a modified firmware keymap where the three missing scancodes are available in the base layer and use your normal OS language keymap.

---

<div class="post-metadata">

**Author:** ![merlin](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/merlin/32/3416_2.png) [@merlin](https://community.keyboard.io/u/merlin)\
**Post date:** [October 27, 2017, 2:19am UTC](https://community.keyboard.io/t/mapping-international-characters/556/7 "2017-10-27T02:19:57Z")

</div>

> [@algernon](#):
>
> But all major operating systems support both of these, it is up to you which one you prefer.

I have not found this to be true for macOS. I spent a while trying to get one to work, and it was a miserable failure. I had been hoping to have to keyboard do it, but the tiny amount of memory it has made that impossible, too.

---

<div class="post-metadata">

**Author:** ![james.nvc](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/james.nvc/32/54_2.png) [@james.nvc](https://community.keyboard.io/u/james.nvc)\
**Post date:** [October 27, 2017, 1:06pm UTC](https://community.keyboard.io/t/mapping-international-characters/556/8 "2017-10-27T13:06:55Z")

</div>

For macOS, I think you need to switch the layout to Unicode Hex input.  
You’ll also need to either have HostOS checking active or explicitly set the OS in the Arduino sketch.  
I have it working on Linux, but haven’t tested yet on OS X/macOS (don’t have the HostOS guessing turned on); I will try to test that later today or tomorrow.

---

<div class="post-metadata">

**Author:** ![merlin](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/merlin/32/3416_2.png) [@merlin](https://community.keyboard.io/u/merlin)\
**Post date:** [October 27, 2017, 1:30pm UTC](https://community.keyboard.io/t/mapping-international-characters/556/9 "2017-10-27T13:30:47Z")

</div>

I don’t remember all the contortions I went through to get a compose key on macOS, but I tried multiple methods that other people had published, none of which worked acceptably well.

The big problem is that Apple has their own (Cocoa) input system for international characters, but it only works in applications built with it, so it (if I recall) doesn’t work in Emacs, and neither did the compose key hack. Getting it to work everywhere is basically impossible, or so much work that it’s pointless to try, though I might give some newer approach a chance anyway, I’m not at all hopeful that it will work in both Cocoa and non-Cocoa apps. (And I find the Cocoa system for international unicode characters to be both much more limited and awkward than a compose key, so I end up mostly not using them, even when I really want to.)

---

<div class="post-metadata">

**Author:** ![lasse](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/lasse/32/185_2.png) [@lasse](https://community.keyboard.io/u/lasse)\
**Post date:** [October 27, 2017, 3:43pm UTC](https://community.keyboard.io/t/mapping-international-characters/556/10 "2017-10-27T15:43:12Z")

</div>

So I tried working with configuring the unicode plugin.

I mapped fn+o to give me unicode(00e5) which should be å.  
I also configured my keyboard input source to be unicode in MacOS.

Pressing the key gives makes the keyboard type “00e5”, so something is wrong.  
I also tried in on windows 10 with the same result.

Here are the changes I made to get the unicode plugin configured:

```
// import plugins
#include "Kaleidoscope-HostOS.h"
#include "Kaleidoscope/HostOS-select.h"
#include "Kaleidoscope-Unicode.h"

// add a alias for the macro
enum { 
   L_AA
 };

 // define macro
 static void unicode(uint32_t codepoint, uint8_t keyState) {
  if (!keyToggledOn(keyState)) {
    return;
  }
  Unicode.type(codepoint);
}

const macro_t *macroAction(uint8_t macroIndex, uint8_t keyState) {
  switch (macroIndex) {

  case L_AA:
    unicode(0x00e5, keyState);
    break;
  }
  return MACRO_NONE;
}

// add to use
Kaleidoscope.use(
  // other plugins here
  // Unicode input
  &Unicode
);

```

And then add M(L\_AA) to keyboard mapping.

But like I wrote it doesn’t work as expected, so something is wrong …

To make things worse I also managed to close the terminal window I was working in and now I can’t get the keyboard to accept my make flash commands …  
Is it an environment variable / path thing or did I manage to brick my keyboard?

```
luke:Model01-Firmware lasse$ make flash
ls: /Users/lasse/Library/Arduino15/packages/keyboardio/hardware/avr/*: No such file or directory
BOARD_HARDWARE_PATH="/Users/lasse/Documents/Arduino/hardware" /Users/lasse/Documents/Arduino/hardware/keyboardio/avr/libraries/Kaleidoscope/bin//kaleidoscope-builder flash
Building output/Model01-Firmware/Model01-Firmware (0.0.0-gv1.13-57-ge6f5-dirty) ...
Press ENTER when ready...

stty: 1200: No such file or directory
make: *** [flash] Error 1
luke:Model01-Firmware lasse$
```

---

<div class="post-metadata">

**Author:** ![lasse](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/lasse/32/185_2.png) [@lasse](https://community.keyboard.io/u/lasse)\
**Post date:** [October 27, 2017, 3:48pm UTC](https://community.keyboard.io/t/mapping-international-characters/556/11 "2017-10-27T15:48:44Z")

</div>

> [@andrewg](#):
>
> The alternative is to use a modified firmware keymap where the three missing scancodes are available in the base layer and use your normal OS language keymap.

That actually sounds like the best approach to me. I keep an old standard keyboard around with physical danish layout. And if I could keep the OS layout as danish as well, that would allow a co-worker to pair program with me, with her using a standard keyboard and me showing off on my model01 🙂

Can you provide some more details on how to go about that?  
Also to consider: If I change my layout to danish brackets go to the AltGr layer. How can I map them? (See also my other thread about a custom brackets key)

> [@Dedicated brackets key](https://community.keyboard.io/t/dedicated-brackets-key/534/13):
>
> I brought up this exact issue in [this thread](https://community.keyboard.io/t/wasd-vs-esdf-for-mouse-movement-keys/129). Jesse says he comfortably uses ring, pinky and middle fingers for those, on WASD! Seems totally outlandish to me! smiling_face

---

<div class="post-metadata">

**Author:** ![algernon](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/algernon/32/4404_2.png) [@algernon](https://community.keyboard.io/u/algernon)\
**Post date:** [October 27, 2017, 3:50pm UTC](https://community.keyboard.io/t/mapping-international-characters/556/12 "2017-10-27T15:50:34Z")

</div>

By default the HostOS plugin does no OS autodetection, so you either have to set that up (by adding a `#define KALEIDOSCOPE_HOSTOS_GUESSER 1` to the top of your sketch, before the includes), or tell it your OS: `HostOS.os(kaleidoscope::hostos::OSX)` somewhere in your `setup()` method.

For the flashing issue, perhaps re-plugging the keyboard would help?

---

<div class="post-metadata">

**Author:** ![james.nvc](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/james.nvc/32/54_2.png) [@james.nvc](https://community.keyboard.io/u/james.nvc)\
**Post date:** [October 27, 2017, 3:51pm UTC](https://community.keyboard.io/t/mapping-international-characters/556/13 "2017-10-27T15:51:59Z")

</div>

The error flashing looks like it’s an environment variable issue…It looks like it’s got ARDUINO\_PATH set to `~/Library/Arduino15` instead of `~/Documents/Arduino` maybe? I’ve been using the Arduino IDE instead of make flash thought, so I’m not sure.

---

<div class="post-metadata">

**Author:** ![andrewg](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/andrewg/32/43_2.png) [@andrewg](https://community.keyboard.io/u/andrewg)\
**Post date:** [October 27, 2017, 4:18pm UTC](https://community.keyboard.io/t/mapping-international-characters/556/14 "2017-10-27T16:18:27Z")

</div>

I have a fork here: [https://github.com/andrewgdotcom/Model01-Firmware](https://github.com/andrewgdotcom/Model01-Firmware) . The particular file you’re interested in is layer-abg-multilingual.h . Note that the aliases assume a us-QWERTY layout so won’t exactly match the key codes generated under your danish OS keymap - but the overall result (which is the important bit) should turn out as you would expect.

I mapped the right alt key (=altgr) to the right thumb cluster so that one can use it like a 3rd level shift key. Just press the same key combination that you normally would on a danish layout (altgr+7890).

Have a look at [README-abg.md](http://README-abg.md) for a full description of the changes.

---

<div class="post-metadata">

**Author:** ![lasse](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/lasse/32/185_2.png) [@lasse](https://community.keyboard.io/u/lasse)\
**Post date:** [October 27, 2017, 4:19pm UTC](https://community.keyboard.io/t/mapping-international-characters/556/15 "2017-10-27T16:19:38Z")

</div>

I tried:

- Plugging in and out multiple times
- Rebooting
- Changing USB ports
- cloning a fresh copy of Model01-Firmware to make sure I didn’t change anything in by mistake

What does the last part of the message mean:

```
stty: 1200: No such file or directory
make: *** [flash] Error 1
```

---

<div class="post-metadata">

**Author:** ![algernon](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/algernon/32/4404_2.png) [@algernon](https://community.keyboard.io/u/algernon)\
**Post date:** [October 27, 2017, 4:23pm UTC](https://community.keyboard.io/t/mapping-international-characters/556/16 "2017-10-27T16:23:43Z")

</div>

That means that its autodetect logic failed, and couldn’t find a port, so it is treating the next argument (the baud rate) as if it was the serial device.

The auto-detection logic there is fragile, and the error messages are awful. Entirely my fault, for writing the script in shell, and failing to do any kind of error detection and handling.

---

<div class="post-metadata">

**Author:** ![andrewg](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/andrewg/32/43_2.png) [@andrewg](https://community.keyboard.io/u/andrewg)\
**Post date:** [October 27, 2017, 4:47pm UTC](https://community.keyboard.io/t/mapping-international-characters/556/17 "2017-10-27T16:47:24Z")

</div>

> [@lasse](#):
>
> If I change my layout to danish brackets go to the AltGr layer. How can I map them?

Ah, I just reread this and I think I know what you mean now. If you want the magic keys in the FN layer to map to Danish bracket keys instead of the QWERTY bracket keys you’ll need to set up four (not two!) new macros taking the Key\_\*CurlyBracket macros as inspiration, but a) instead of using Key\_LeftShift as the modifier key, use Key\_RightAlt and b) use 7890 as the target keys rather than .

---

<div class="post-metadata">

**Author:** ![lasse](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/lasse/32/185_2.png) [@lasse](https://community.keyboard.io/u/lasse)\
**Post date:** [October 27, 2017, 5:15pm UTC](https://community.keyboard.io/t/mapping-international-characters/556/18 "2017-10-27T17:15:38Z")

</div>

Thanks you for taking the time to trying to understand my ramling 😉  
It might be easier to understand if you have a look at a classic danish pc105 layout:

 ![](https://canada1.discourse-cdn.com/flex031/uploads/keyboard/original/1X/e5257302600ae7a66111f399a495a942fa9fed29.jpg)

So as you can see programming brackets go to AltGr + 7,8,9,0

What should I write in the keyboard layer to address that?

---

<div class="post-metadata">

**Author:** ![lasse](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/lasse/32/185_2.png) [@lasse](https://community.keyboard.io/u/lasse)\
**Post date:** [October 27, 2017, 5:30pm UTC](https://community.keyboard.io/t/mapping-international-characters/556/19 "2017-10-27T17:30:55Z")

</div>

> [@algernon](#):
>
> That means that its autodetect logic failed, and couldn’t find a port, so it is treating the next argument (the baud rate) as if it was the serial device.

Anything I can try to get more info?  
Would it help if I found a linux box or do a hard reset or something else??

---

<div class="post-metadata">

**Author:** ![andrewg](https://yyz1.discourse-cdn.com/flex031/user_avatar/community.keyboard.io/andrewg/32/43_2.png) [@andrewg](https://community.keyboard.io/u/andrewg)\
**Post date:** [October 27, 2017, 5:37pm UTC](https://community.keyboard.io/t/mapping-international-characters/556/20 "2017-10-27T17:37:20Z")

</div>

Yes, I looked that up to see where the brackets were on Danish. AltGr is the Butterfly key on the stock firmware, so it should Just Work. Set your OS keymap to Danish and nothing more needs done - you have brackets.

Where you _will_ find problems with the stock firmware is finding the Å¨^’\* keys from the top right and the \<\> key in the bottom left - these are the us-QWERTY []\ keys and they don’t exist on the base layer. The first three and their magically-shifted counterparts are found on the Fn layer (they’re the ones labelled “[]{}\|” ), but the \<\> key does not exist anywhere at all.

Which is where the multilingual layout in my fork comes in - I move PgUp, PgDn and Num to the Fn layer and trash the Any key, giving four spare keys that can be used for these four “missing” keys. And because they’re on the base layer, you don’t need to use the magic-shifted keys.

[Next page](https://community.keyboard.io/t/mapping-international-characters/556.md?page=2)
