back to ~/

the altair-x incident

After months of browsing r/ErgoMechKeyboards, I finally caved and bought a fully-aluminum, split, 50-key ergonomic keyboard. The official reason was that my wrists were starting to hurt, but the real reason goes back to the start of the pandemic, when I discovered the rabbit hole of custom mechanical keyboards and immediately became that friend who can differentiate switch types by sound alone.

My keyboard journey started pretty normally: an Anne Pro 2, 60%, Cherry MX Blues. Clicky, loud, and horrible in the way all first mechanical keyboards are. A couple of years later I made a big jump and bought an HHKB Pro 2 with 45g Topre switches, which carried me through university. I still love Topre. It feels like typing on expensive mashed potatoes, but somehow that is a compliment.

Then, mostly influenced by ThePrimeagen, I bought a refurbished Kinesis Advantage 360. I liked the idea: split keyboard, thumb clusters, less wrist movement. But I did not like the execution. It was not truly split, and it was also too tall for my wrists, which somehow made the pain worse. Very cool. Very ergonomic. Thank you.

So when the first round of group buys for the Altair by ai03 dropped, I knew this keyboard was my destiny. Or at least the next compulsive buy I would convince myself was worth it. The Altair-X is a 50-key split ergonomic keyboard with an aluminum case, column stagger, thumb keys, and just enough keys to make you question whether it is a real keyboard. It looks like a serious object. It weighs just enough to kill a small person if hit in the head. Sorry, too specific.

altair-x keyboard
altair-x by ai03

Naturally, I did not just use the default layout. Instead, I wrote my own QMK layout, loosely inspired by Miryoku, but keeping QWERTY, I’m no sociopath.

miryoku layout
the miryoku layout, by manna-harbour

The base layer is mostly letters and a few essentials, and everything else lives underground. Numbers, symbols, navigation, function keys, gaming mode, debug shortcuts, bootloader — all layers. There are also some very specific “me problems” in there: $ and € share a custom key, ! and ? have their own helper, ^ and ~ are fixed because dead keys are annoying, and I have keys for “go to definition” and “go to implementation,” because apparently even my keyboard needs to know I spend too much time inside IDEs.

The worst offender is probably ALT_MO3, which started as a layer key and became a small firmware-based personality disorder. Hold it and I get my num layer. Double-tap it and it becomes Alt. Use it with my custom ALT_TAB key and it keeps Alt held so I can cycle windows without doing finger parkour. This is either elegant or evidence to send me to a psychiatric ward. No in-between.

This keyboard is also what finally made Vim bindings click for me. I had tried to learn Vim motions a few times before, but I could never fully commit to them. I would install Neovim distros like LazyVim, extensions like VsVim, feel productive for 15 minutes, then immediately crawl back to normal controls the moment I needed to do real work. But after using the Altair-X, Vim started making sense. The whole keyboard was already built around not moving my hands: layers, thumb keys, home-row philosophy. So I forced myself to use the keyboard at work for two weeks straight with VsVim enabled, and annoyingly, it worked. Now hjkl feels normal. Motions feel natural. Editing without Vim bindings feels like eating soup with a fork. I hate that I have become this person, but I cannot go back. It also feels like a side quest while you program. You are not only thinking about what you are programming, but also subconsciously trying to get a certain outcome with the fewest key presses possible. Like a puzzle, but for nerds. Wait, puzzles are already for nerds.

The downside is that nobody else can use my keyboard now. They can type letters, sure, but the moment they need a number, a symbol, an arrow key, or basic human dignity, it’s all over. So I keep a regular keyboard plugged into the back of my PC in case somebody ever needs to use it. A small emergency keyboard. A guest keyboard. A keyboard for people who have not yet ruined their lives and wallets with this fantastic hobby.

For now, this is probably my endgame. Obviously “endgame” is a fake word keyboard enthusiasts use right before buying another keyboard, but I mean it. Mostly. The Altair-X fixed the wrist problem, feels amazing, and has become weirdly personal in a way normal peripherals are not. That said, if another group buy round happens, I might get a second one. Not because I need it. Obviously not. That would be absurd. Just one to keep as a backup in case this one breaks, or maybe one for home and one for the office, because right now I carry it around in its carrying case and every time I do I look slightly like a businessman transporting important documents. What people don’t know is that the important document is a keyboard with seven layers.

/* Copyright 2024 ai03 Design Studio */
/* SPDX-License-Identifier: GPL-2.0-or-later */

#include QMK_KEYBOARD_H
#define __ KC_NO

enum custom_keycodes {
    ALT_MO3 = SAFE_RANGE,
    ALT_TAB,
    FS_BS,
    EX_Q,
    DOLLAR_EUR,
    CARET_FIXED,
    TILDE_FIXED,
    GOTO_DEF,
    GOTO_IMPL,
    TOGGLE_DEBUG,
};

enum combos {
    COMBO_TOGGLE_GAMING_LAYER,
    COMBO_TOGGLE_NUM_LAYER,
    COMBO_TOGGLE_CONFIG_LAYER,
    COMBO_LENGTH,
};

const uint16_t PROGMEM combo_gaming[] = {KC_F12, KC_MUTE, COMBO_END};
const uint16_t PROGMEM combo_num[]    = {KC_F10, KC_VOLU, COMBO_END};
const uint16_t PROGMEM combo_config[] = {KC_F10, KC_F12, COMBO_END};

combo_t key_combos[] = {
    [COMBO_TOGGLE_GAMING_LAYER] = COMBO(combo_gaming, TG(4)),
    [COMBO_TOGGLE_NUM_LAYER]    = COMBO(combo_num, TG(2)),
    [COMBO_TOGGLE_CONFIG_LAYER] = COMBO(combo_config, TG(6)),
};

const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {

// Base Layer
[0] = LAYOUT(
    KC_ESC,           KC_Q,    KC_W,    KC_E,       KC_R,       KC_T,                 __,        /*||*/            __,     KC_Y,       KC_U,       KC_I,       KC_O,      KC_P,       KC_DEL,
    CTL_T(KC_TAB),    KC_A,    KC_S,    KC_D,       KC_F,       KC_G,                 __,        /*||*/            __,     KC_H,       KC_J,       KC_K,       KC_L,      KC_SCLN,    KC_QUOT,
    KC_LSFT,          KC_Z,    KC_X,    KC_C,       KC_V,       KC_B,                 __,        /*||*/            __,     KC_N,       KC_M,       KC_COMM,    KC_DOT,    KC_SLSH,    EX_Q,
                                        KC_LGUI,    ALT_MO3,    LT(3, KC_SPC),     MO(1),        /*||*/        KC_ENT,     KC_BSPC,    KC_RSFT,    TOGGLE_DEBUG
),

// Symbols Layer
[1] = LAYOUT(
    KC_ESC,     DOLLAR_EUR,      KC_NUBS,        LSFT(KC_NUBS),    RALT(KC_3),    LSFT(KC_RBRC),  __,         /*||*/        __,        CARET_FIXED,     RALT(KC_QUOT),   RALT(KC_BSLS),  LSFT(KC_2),      KC_MINS,        KC_DEL,
    KC_TAB,     RALT(KC_GRV),    RALT(KC_LBRC),  RALT(KC_RBRC),    LSFT(KC_0),    LSFT(KC_6),     __,         /*||*/        __,        RALT(KC_1),      LSFT(KC_8),      LSFT(KC_9),     LSFT(KC_COMM),   FS_BS,          KC_QUOT,
    KC_LSFT,    KC_RBRC,         KC_LBRC,        LSFT(KC_5),       RALT(KC_2),    TILDE_FIXED,    __,         /*||*/        __,        __,              __,              KC_COMM,        KC_DOT,          LSFT(KC_SLSH),  EX_Q,
                                                 __,               __,            __,             __,         /*||*/        KC_ENT,    KC_BSPC,         KC_RSFT,         __
),

// Num Layer
[2] = LAYOUT(
    KC_ESC,    __,         __,        __,        __,    __,     __,        /*||*/        __,        __,         KC_7,       KC_8,    KC_9,    __,            KC_DEL,
    ALT_TAB,   __,    KC_PMNS,   KC_PPLS,      KC_0,    __,     __,        /*||*/        __,        KC_PAST,    KC_4,       KC_5,    KC_6,    LSFT(KC_5),    __,
    KC_LSFT,   __,         __,        __,        __,    __,     __,        /*||*/        __,        KC_PSLS,    KC_1,       KC_2,    KC_3,    RALT(KC_E),    __,
                                      __,        __,    __,     __,        /*||*/        KC_ENT,    KC_BSPC,    __,         __
),

// Navigation Layer
[3] = LAYOUT(
    KC_ESC,     KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6,       /*||*/        KC_F7,     KC_F8,      KC_F9,      KC_F10,  KC_F11,    KC_F12,     KC_DEL,
    KC_LCTL,    __,    __,    __,    __,    __,    __,          /*||*/        __,        KC_LEFT,    KC_DOWN,    KC_UP,   KC_RGHT,   __,         __,
    KC_LSFT,    __,    __,    __,    __,    __,    __,          /*||*/        __,        __,         __,         __,      __,        __,         __,
                              __,    __,    __,    __,          /*||*/        KC_ENT,    KC_BSPC,    __,         __
),

// Gaming Layer
[4] = LAYOUT(
    KC_ESC,    __,         KC_Q,         KC_W,         KC_E,        KC_R,      KC_T,        /*||*/        __,         __,         __,    __,    __,    __,    __,
    KC_TAB,    KC_LSFT,    KC_A,         KC_S,         KC_D,        KC_F,      KC_G,        /*||*/        __,         __,         __,    __,    __,    __,    __,
    __,        KC_LCTL,    KC_Z,         KC_X,         KC_C,        KC_V,      KC_B,        /*||*/        __,         __,         __,    __,    __,    __,    __,
                                         KC_LGUI,      KC_LALT,     KC_SPC,    KC_H,        /*||*/        KC_ENT,     KC_BSPC,    __,    __
),

// Debug Layer
[5] = LAYOUT(
    TOGGLE_DEBUG,   __,    __,      __,      KC_F3,   __,          __,          /*||*/        __,      __,       __,    __,    __,    __,    __,
    KC_TAB,         __,    KC_F12,  KC_F11,  KC_F10,  LCTL(KC_O),  __,          /*||*/        __,      __,       __,    __,    __,    __,    __,
    KC_LSFT,        __,    __,      __,      KC_F5,   LCTL(KC_I),  __,          /*||*/        __,      __,       __,    __,    __,    __,    __,
                                    KC_LGUI, KC_LALT, GOTO_IMPL,   GOTO_DEF,    /*||*/        KC_ENT,  KC_BSPC,  __,    __
),

// Config Layer
[6] = LAYOUT(
    __,    __,    __,    __,    __,    __,    __,          /*||*/        QK_BOOT,    __,    __,    __,    __,    __,    __,
    __,    __,    __,    __,    __,    __,    __,          /*||*/        __,         __,    __,    __,    __,    __,    __,
    __,    __,    __,    __,    __,    __,    __,          /*||*/        __,         __,    __,    __,    __,    __,    __,
                         __,    __,    __,    __,          /*||*/        __,         __,    __,    __
)
};

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
    static bool alt_started = false;
    static uint16_t alt_mo3_timer = 0;
    static uint8_t tap_count = 0;
    static bool alt_mode = false;

    switch (keycode) {
        case ALT_MO3:
            if (record->event.pressed) {
                uint16_t now = timer_read();
                if (timer_elapsed(alt_mo3_timer) < TAPPING_TERM) {
                    tap_count++;
                    if (tap_count >= 2) {
                        register_code(KC_LALT);
                        alt_mode = true;
                    }
                } else {
                    tap_count = 1;
                }
                alt_mo3_timer = now;

                if (!alt_mode) {
                    layer_on(2);
                    alt_started = false;
                }
            } else {
                if (alt_mode) {
                    unregister_code(KC_LALT);
                    alt_mode = false;
                    tap_count = 0;
                } else {
                    if (alt_started) {
                        unregister_code(KC_LALT);
                        alt_started = false;
                    }
                    layer_off(2);
                }
            }
            return false;
        case ALT_TAB:
            if (record->event.pressed) {
                if (!alt_started && !alt_mode) {
                    register_code(KC_LALT);
                    tap_code(KC_TAB);
                    alt_started = true;
                } else {
                    tap_code(KC_TAB);
                }
            }
            return false;
       case FS_BS:
            if (record->event.pressed) {
                uint8_t mods = get_mods();
                if (mods & MOD_MASK_SHIFT) {
                    del_mods(MOD_MASK_SHIFT);
                    add_mods(MOD_BIT(KC_RALT));
                    tap_code(KC_GRV);
                    del_mods(MOD_BIT(KC_RALT));
                    set_mods(mods);
                } else {
                    tap_code16(S(KC_7));
                }
            }
            return false;
        case EX_Q:
            if (record->event.pressed) {
                if (get_mods() & MOD_MASK_SHIFT) {
                    tap_code16(S(KC_MINS));
                } else {
                    tap_code16(S(KC_1));
                }
            }
            return false;
        case DOLLAR_EUR:
            if (record->event.pressed) {
                uint8_t mods = get_mods();
                if (mods & MOD_MASK_SHIFT) {
                    del_mods(MOD_MASK_SHIFT);
                    add_mods(MOD_BIT(KC_RALT));
                    tap_code(KC_E);
                    del_mods(MOD_BIT(KC_RALT));
                    set_mods(mods);
                } else {
                    tap_code16(S(KC_4));
                }
            }
            return false;

        case CARET_FIXED:
            if (record->event.pressed) {
                tap_code16(LSFT(KC_LBRC));
                tap_code(KC_SPC);
            }
            return false;

        case TILDE_FIXED:
            if (record->event.pressed) {
                add_mods(MOD_BIT(KC_RALT));
                tap_code(KC_4);
                del_mods(MOD_BIT(KC_RALT));
                tap_code(KC_SPC);
            }
            return false;

        case GOTO_DEF:
            if (record->event.pressed) {
                tap_code(KC_SPC);
                tap_code(KC_G);
                tap_code(KC_D);
            }
            return false;

        case GOTO_IMPL:
            if (record->event.pressed) {
                tap_code(KC_SPC);
                tap_code(KC_G);
                tap_code(KC_I);
            }
            return false;

        case TOGGLE_DEBUG:
            if (record->event.pressed) {
                if (layer_state_is(5)) {
                    layer_off(5);
                } else {
                    layer_on(5);
                }
                tap_code(KC_F13);
            }
            return false;
    }

    return true;
}