LUCAS.DEV
Blog post hero image

Using Nordic characters on ANSI-keyboard with VIA configurator

Introduction

As a Dane 🇩🇰 who uses Nordic characters a lot, it may seem counterintuitive to use an ANSI-layout keyboard, but as a web developer and a custom mechanical keyboard hobbyist, it makes perfect sense.

The ANSI-layout is simply much better for programming, and the custom mechanical keyboard market is relatively small, so it caters mostly to ANSI users. The only problem is, I don’t have quick access to the Nordic characters that are often used in the Danish language (ÆØÅ).

My custom built RAMA WORKS KOYU mechanical keyboard with ANSI-layout

I use a RAMA WORKS KOYU keyboard on both Mac and Windows. This guide should work with macOS and Windows, as long as your keyboard uses the VIA configurator. If you’ve already tinkered a bit with VIA, you may have come to the realization that the list of characters you can pick from is very limited. When I was researching this problem, I came across this Reddit post by someone dealing with the exact same problem, with commenters claiming it was impossible to do in VIA. Unsatisfied with what I found online, I started experimenting on my own.

The trick is to combine macros and alt codes to insert special characters on key presses. I use this method to type Nordic characters (ÆØÅ), but you can use any special character you want — as long as there’s an alt code for it.

Guide

Step 1

Open the VIA configurator and link your keyboard → https://usevia.app

VIA configurator

Step 2

Find the alt code(s) for the character(s) you want to use. This depends on the operating system you use.

Windows

Good resource for alt codes on Windows: https://www.alt-codes.net

Examples:

CharacterAlt code
æAlt + Numpad 1 + Numpad 4 + Numpad 5
øAlt + Numpad 0 + Numpad 2 + Numpad 4 + Numpad 8
åAlt + Numpad 1 + Numpad 3 + Numpad 4

Don’t worry if you do not have a numpad. You don’t need one!

Mac

Good resource for alt codes on macOS: https://www.webnots.com/option-or-alt-key-shortcuts-to-insert-symbols-in-mac-os-x

Examples:

CharacterAlt code
æ + '
ø + O
å + A

Step 3

From the Macros panel in VIA, pick an empty macro slot and enter the Basic Keycodes for the characters that make up the alt code you want to use. Separate your keycodes by comma and wrap everything in curly brackets {}. For example, if I want to insert æ on Windows, I would enter {KC_LALT,KC_P1,KC_P4,KC_P5}. On macOS, I would write {KC_LALT,KC_QUOT}. Alternatively, you can record your keystrokes and have VIA figure out the keycodes.

For a list of Basic Keycodes, check out the QMK documentation.

Modifying macros from the VIA configurator

Step 4

Assign the macro to a key on your keyboard. You can assign it to a key on a different layer if you want to only trigger the macro when holding down a specific key.

On my keyboard, I’ve assigned Right Alt to switch to layer 3 while being held. On layer 3, that’s where I assign my newly created macros to the keys I want to use. This allows me to use Æ, Ø, and Å with a keyboard shortcut, while preserving the default key behavior when the layer-switching key (Right Alt) isn’t being held.

Assigning the macros to keys from the VIA configurator

Since I use both Windows and macOS, I’ve created macros for each operating system and assigned them on separate layers. This way, when I’m on Windows, I can use my “Windows layer,” and when I’m on my Mac, I can switch to my “macOS layer.”

Final thoughts

The cool thing about this is that it works with lowercase characters, as well as uppercase characters. When I trigger each macro, it will insert a lowercase character by default, since that’s what my alt code dictates. However, if I trigger the same macro while holding Shift, it will insert a capitalized version of the character. This allows me to use Nordic characters on an ANSI-layout keyboard with minimal hindrance.

This simple ANSI/VIA problem had seemingly no solution available on the internet. The solution happens to be relatively straight forward, and I’m happy to share it with you here. I hope this helped you in some way. It certainly helped me 🙂.

PublishedAuthorHits
September 15, 2024Lucas Taylor659