# Map to special characters, Dual OS

**URL:** <https://community.keyboard.io/t/map-to-special-characters-dual-os/1131>\
**Category:** Help and Getting Started\
**Created:** [February 26, 2018, 10:00pm UTC](https://community.keyboard.io/t/map-to-special-characters-dual-os/1131 "2018-02-26T22:00:43Z")\
**Posts on this page:** 5\
**Page:** 2

<div class="post-metadata">

**Author:** ![Vimes](https://avatars.discourse-cdn.com/v4/letter/v/a3d4f5/32.png) [@Vimes](https://community.keyboard.io/u/Vimes)\
**Post date:** [March 11, 2018, 6:01pm UTC](https://community.keyboard.io/t/map-to-special-characters-dual-os/1131/21 "2018-03-11T18:01:40Z")

</div>

So you still have to press “fn” after pressing AltGr? Do you have a drawn keymap? Maybe I can just use yours, if it seems to make sense, I’m was hesitant to use anything that did not have a keymap I could look at whenever I get frustrated though,

---

<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:** [March 11, 2018, 6:14pm UTC](https://community.keyboard.io/t/map-to-special-characters-dual-os/1131/22 "2018-03-11T18:14:25Z")

</div>

> [@Vimes](#):
>
> So you still have to press “fn” after pressing AltGr?

No, that’s not how it works. `fn` isn’t a key that sends a keycode to the computer; instead it changes layers, so the other keys on the keyboard send different keycodes to the computer. And the keys in question trigger a macro that sends a sequence of key presses (and releases) like this: `right alt`, `a`, `e`. So all you do is hold down `fn` (or whatever key you configure to switch to the layer where you have your compose key macros), and tap `p` (or whatever), and you’ll get `æ`.

---

<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:** [March 11, 2018, 6:56pm UTC](https://community.keyboard.io/t/map-to-special-characters-dual-os/1131/23 "2018-03-11T18:56:27Z")

</div>

I went ahead and made a working version of what I think you want. You’ll have to change one line, to make the `compose()` function send your Compose key of choice:

> <https://github.com/gedankenexperimenter/Model01-Firmware/blob/c6821f188954e63219189c995497e929e68741d8/Model01-Firmware.ino#L251>

This sketch adds a layer called `BOKMAL` with the compose key shortcuts. It changes two keys on the `QWERTY` layer: right `ctrl` becomes a layer-shift key – when it’s held, the new layer is active; the `any` key becomes a toggle: press it once, and the `BOKMAL` layer becomes active, press it again, and it deactivates.

Please feel free to ask me any questions about how it works.

---

<div class="post-metadata">

**Author:** ![Vimes](https://avatars.discourse-cdn.com/v4/letter/v/a3d4f5/32.png) [@Vimes](https://community.keyboard.io/u/Vimes)\
**Post date:** [March 11, 2018, 8:51pm UTC](https://community.keyboard.io/t/map-to-special-characters-dual-os/1131/24 "2018-03-11T20:51:21Z")

</div>

I should have understood that you did not have to actually press the FN key from the beginning, thanks for the nice explanation.

And thanks for the code! It works wonderfully, now I just have to figure out what to do with the keyboardio key. I can probably do that by myself. Your “BOKMAAL” looks a bit like what I tried to make in the beginning.

thank you ever so much! This will be the perfect keyboard to learn programming on. I’ll probably make more posts in the future after I get good at typing on this keyboard, then the next goal is to get good at hacking it.

---

<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:** [March 11, 2018, 9:35pm UTC](https://community.keyboard.io/t/map-to-special-characters-dual-os/1131/25 "2018-03-11T21:35:16Z")

</div>

> [@Vimes](#):
>
> Do you have a drawn keymap?

Now I do:

> [@Share your layout](https://community.keyboard.io/t/share-your-layout/296/27):
>
> I posted the code to my layout several times in the forum. But I finally found the time to make an image of the layout: Code and comments can be found here:

[Previous page](https://community.keyboard.io/t/map-to-special-characters-dual-os/1131.md?page=1)
