vim, git, aws and other three-letter words

Software Development Notes

Keyboard Firmware Links

Links related to keyboard firmware.

QMK   folded

QMK Basics – Thomas Baart and info

Configuration   folded

Layer toggle types   folded

  • Momentary (MO):
    • This is like a Shift key. Hold down a momentary toggle, and you're taken to another layer. Let go, and you drop back to layer 0.
    • As soon as you let go of the key, the layer is deactivated and you pop back out to the previous layer.
    • When you apply this to a key, that same key must be set as KC_TRNS on the destination layer. Otherwise, you won't make it back to the original layer when you release the key (and you'll get a keycode sent).
    • You can only switch to layers above your current layer. If you're on layer 0 and you use MO(1), that will switch to layer 1 just fine. But if you include MO(3) on layer 5, that won't do anything for you – because layer 3 is lower than layer 5 on the stack.
  • Toggle (TG):
    • This is similar to a Caps Lock. Tap once, and you're moved to that layer. You'll stay on that layer until you tap the layer toggle key again. Depending on the type, you'll momentarily/permanently have access to the key bindings of that specific layer.
  • One-shot (OSL):
    • Tap this key, and you're moved to the layer. Tap a single key on the layer, and you will then be sent back to layer 0. Like Shift, but without having to hold down two keys at once.
    • This type of layer switch allows you to either tap it and get the next layer for one key press or hold it and continue to get that next layer until you release it. It's wonderful for the types of keys we'll be looking at on Layer 1.
  • OSM(mod) - this is a "one shot" modifier. - sticky shift
    • So let's say you have your left Shift key defined as OSM(MOD_LSFT). Tap it, let go, and Shift is "on" – but only for the next character you'll type. So to write "The", you don't need to hold down Shift – you tap it, tap t, and move on with life. And if you hold down the left Shift key, it just works as a left Shift key, as you would expect (so you could type THE). There's also a magical, secret way to "lock" a modifier by tapping it multiple times. If you want to learn more about that, open an issue. :)
  • Tap-Toggle (TT):
    • A combination of Momentary and Toggle. Hold this key, and the layer is active only as long as you hold it. Tap it briefly, and you're moved to the destination layer until you tap it again.
  • Direct switch (TO):
    • All other layer switches go up (allow you to switch from layer 0 to layer 1, for example). TO is the only one which also allows you to switch down (from layer 3 to layer 2, for example).
  • Meh / Hyper keys
    • System-level shortcuts to switch to apps

Retro tapping   folded

  • MT(Mod, X) will send X if the key is held longer than tapping term. Retro Tap thus gives another way to trigger the tapping function of mod-taps. With this option, you can get away with a very short tapping term.
  • Tapping term is short, so it is easier to do Hold
  • What if we set tapping term to zero? (so any keypress is "Hold")
    • When used in combination with other keys, mod will always be Hold
  • What if we set tapping term to infinity? (so any keypress is "Tap")
    • We can get "nested hold, rolling tap" behavior with
    • MT = Nested=Hold, Rolling=Tap -> PERMISSIVE_HOLD + IGNORE_MOD_TAP_INTERRUPT
    • LT = Nested=Hold, Rolling=Tap -> PERMISSIVE_HOLD
    • This is also a behavior that looks natural to me, so it might be possible to go without tapping term
      • When should keys be processed in this case? Should we wait until all are released?
      • What if we are on a layer or holding Shift?

Tap-Hold Configuration   folded

  • TAPPING_TERM 200 Tapping Term - determines what is a tap and what is a hold
    • TAPPING_TERM_PER_KEY + get_tapping_term() function to define term per key
  • #define PERMISSIVE_HOLD Permissive Hold - do not take tapping term into account for mod taps (hold mod, press and release another key will always work, even if done faster than tapping term)
    • Makes tap and hold keys (like Mod Tap) work better for fast typists, or for high TAPPING_TERM settings
    • Note: always enabled for TAPPING_TERM >= 500
    • For Instance:
      • SFT_T(KC_A) Down
      • KC_X Down
      • KC_X Up
      • SFT_T(KC_A) Up
      • Normally, if you do all this within the TAPPING_TERM, by default 200ms, this will be registered as ax by the firmware and host system.
      • With permissive hold enabled, this modifies how this is handled by considering the Mod Tap keys as a Mod if another key is tapped, and would be registered as X (SHIFT+x).
    • Permissive Hold, and two keymaps by agbell · Pull Request #1359 · qmk/qmk_firmware
    • Note: it looks like permissive hold only works for MT (mod tap), but not for LT
      • Maybe not, this is mentioned in PR comments, but it may have changed since then
      • PERMISSIVE_HOLD_PER_KEY + get_permissive_hold() to define permissive hold per key
  • #define IGNORE_MOD_TAP_INTERRUPT Ignore Mod Tap Interrupt - allow to release modifier before the other key (rolling through mod and key), need to hold both down during the tapping term (or is this the opposite, where enabling ignore mod tap interrupt makes rolling input produce regular keys and enables mod ONLY AFTER waiting for the tapping term)
    • Setting Ignore Mod Tap Interrupt requires holding both keys for the TAPPING_TERM to trigger the hold function (the mod)
    • For Instance:

      • SFT_T(KC_A) Down
      • KC_X Down
      • SFT_T(KC_A) Up
      • KC_X Up

      Normally, this would send X (SHIFT+x). With Ignore Mod Tap Interrupt enabled, holding both keys are required for the TAPPING_TERM to register the hold action.

      • Bad example, as "normally" here does not say if that is done before or after the tapping term
      • A quick tap will output ax in this case, while a hold on both will still output X (SHIFT+x).
    • Note: This only concerns modifiers and not layer switching keys.
      • Not sure why, logically layers should work exactly the same as regular modifiers
      • IGNORE_MOD_TAP_INTERRUPT_PER_KEY + get_ignore_mod_tap_interrupt to set per key
  • Ignore Mod Tap Interrupt + Permissive Hold Modifier added when rolling (modifier released first) instead of waiting for other key release (like in permissive hold) or when both keys are held for tapping term

    • If you have Permissive Hold enabled, as well, this will modify how both work.
    • The regular key has the modifier added if the first key is released first or if both keys are held longer than the TAPPING_TERM.

    Not sure, but probably this means that:

    • SFT_T(KC_A) Down - KC_X Down - SFT_T(KC_A) Up - KC_X Up
    • will always produce Shift-x?
    • Isn't it more logical to always have SFT Down - X down - X Up - Shift Up to trigger Shift-x?
    • Again, the description is confusing: "The regular key has the modifier added if the first key is released first" - what is the 'first' key here, is this always a mod key?
  • #define TAPPING_FORCE_HOLD Tapping Force Hold - disable key repeat on tap followed by tap+hold (act as hold instead of key repeat)

    • Usually, this is a way to activate the repeat function on mod taps

    But it does not work well, for example, when I have backspace on a layer that is activated with space

    • When I type "xyz" and want to delete it, I do
    • x - y - z - left space - hold left space - right space (as backspace)
    • so here I have the "left space - hold left space" which would trigger space repeat normally, while I do not want this
    • TAPPING_FORCE_HOLD_PER_KEY + get_tapping_force_hold for per key setting
  • Retro Tapping - releasing the Mod key without pressing another will send the original keycode even if it is outside the tapping term (regular behavior: #define RETRO_TAPPING: no output)
    • For instance, holding for tapping term and releasing LT(2, KC_SPACE) will output space (by default - nothing)
    • RETRO_TAPPING_PER_KEY + get_retro_tapping for per key setting
  • okke's Cheatsheet on MT and LT
  • [Feature Request] Permissive Hold and Ignore Mod Tap Interrupt for LT · Issue #8971 · qmk/qmk_firmware
  • Questions
    • permissive hold is always enabled when tapping term > 500 - how is the tapping term used then? tapping term determines what is a tap and what is a hold, but now hold ignores the tapping term
    • is retro tapping useful for anything else? the obvious case is a habit to often keep keys pressed for too long like when thinking about something
    • am I understanding ignore mod tap interrupt right?
      • permissive hold: nested key press ("mod down - key down - key up - mod up") = always mod+key (hold action)
      • ignore mod tap interrupt: rolling key press ("mod down - key down - mod up - key up") holding keys longer than tapping term = mod+key
      • ignore mod tap interrupt + permissive hold: rolling key press ("mod down - key down - mod up - key up") = always mod+key
        • maybe: both nested and rolling key press are counted as mod (so this is just a "stronger" option than permissive hold)
      • there is also a discussion here [Feature Request] Permissive Hold and Ignore Mod Tap Interrupt for LT · Issue #8971 · qmk/qmk_firmware
      • In general: it looks like these two settings are overcomplicated, and could be a multi-choice option instead of the combination of settings
        • Default: wait for tapping term (shorter - regular key, longer - mod)
        • Other key is pressed / released while mod is held (regardless of time) - apply mod
        • Other key is pressed while mod is held (can be released after, regardless of time) - apply mod
        • if QMK has unit tests, it would be great to emulate and check how it works via test (set some settings, run key sequences, check the result) - to be sure how it works
        • but sigprof just tested manually, using 499 tapping term
        • AND they are adding alternative options for LT mods (current options are for MT, but affect LT too)

[home key mods + fast typing] 111WPM   folded

home key mods + fast typing: 111WPM on a Dactyl Manuform with homerow mods and Colemak-DHM : ErgoMechKeyboards

  • I've enabled pretty much every tap hold configuration setting and tweaked the tapping term on a per key basis based on frequency of the modifier and the tendency of some of my fingers to rest longer on the key. This is, for example, why I added 200ms to the tapping term of the HOME_I key as my ring finger tended to rest oddly long on the key when typing n-grams such as "ion".
  • Recently, in an effort to lower the tapping term for my shift modtaps even more, I've been toying with canceling the effect of shift on the adjacent keys. So if I hit "N" with right shift on, I probably intended to write "en" instead. So in those cases, instead of sending "N", the firmware sends "en". As a consequence, capital "N" can only be typed with the opposite shift.

Related:

Retro Shift - allows using AutoShift with dual-mod keys (hold longer and let go - shifted symbol, use with another key - mod)

Retro Shift (Auto Shift for Tap Hold via Retro Tapping) : ErgoMechKeyboards

The Leader key: A new kind of modifier

source code   folded

ZMK (bluetooth firmware)   folded

KMK (python-based firmware)   folded

Keyboard firmware   folded

Lists of Keyboard Firmware

  • awesome-mechanical-keyboard/firmware.md at master · Keycapsss/awesome-mechanical-keyboard
    • Firmware
    • BlueMicro_BLE - A Bluetooth Firmware for the NRF52832.
    • Bluetosis - Bluetooth firmware for the Mitosis keyboard.
    • EasyAVR - is a keyboard firmware and keymapper GUI for custom keyboards based on USB AVRs.
    • Kaleidoscope - Flexible firmware for Arduino-powered keyboards.
    • Keyplus - An easy to use keyboard firmware with support for wireless and wired split keyboards.
    • KMK - is a feature-rich and beginner-friendly firmware for computer keyboards written and configured in CircuitPython.
    • Mechy - Arduino compatible, plugin based.
    • MK32 - Simple BLE keyboard for ESP32
    • nrf52-keyboard - A ble keyboard firmware using nrf52810/52832
    • Python-Keyboard - A highly extensible firmware written in Python, based on CircuitPython, with RGB, USB and Bluetooth.
    • QMK - A keyboard firmware based on the tmk_keyboard firmware for Atmel AVR and ARM controllers.
    • TMK - Keyboard firmwares for Atmel AVR and Cortex-M.
    • ZMK - MIT-licensed firmware built on top of the Zephyr RTOS that is "wireless first".
    • kbd-prettier - Automatically format your keyboard layout
    • Keyboard Firmware Builder - Online QMK Firmware Builder (2+ years behind QMK firmware master)
    • Q2K - A python based utility for parsing QMK Firmware keymaps to various outputs
    • QMK Configurator - An open source configurator for QMK Firmware
    • qmk_emote_macro_generator - Easily generate QMK macro/leader sequences for arbitrary unicode sequences.
    • TMK Firmware Builder - Online TMK Firmware Builder
  • help-14/mechanical-keyboard: DIY mechanical keyboard and where to find them
    • EasyAVR - EasyAVR is a keyboard firmware and keymapper GUI for custom keyboards based on USB AVRs. It is powerful but also really easy to use.
    • The VIA - QMK based firmware for the view app.
    • Anne Key - Firmware for Anne Pro Keyboard written in Rust.
    • Lotlab/nrf52-keyboard - TMK based keyboard firmware for nRF52 series, now support both nRF52810 and nRF52832.
    • Lotlab/nrf51822-keyboard - This is a firmware based on nrf51822 Bluetooth keyboard, which uses nRF SDK 10.0 as the underlying hardware driver, and uses TMK keyboard library as the upper part of the keyboard function.
    • Polymer firmware - Polymer keyboard firmware.
    • Pipit keyboard - Firmware and config tools for chording keyboards.
    • python-keyboard - A highly extensible firmware written in Python, based on CircuitPython, with RGB, USB and Bluetooth. similar to TMK/QMK.
  • Firmware - Keebfol.io (firmware list)
  • firmware - MechanicalKeyboards (firmware list)

Rust Firmware

Real-Time OS Basics: Picking The Right RTOS When You Need One | Hackaday

Introduction to RTOS Part 1 - What is a Real-Time Operating System (RTOS)? | Digi-Key Electronics - YouTube

pop-os/keyboard-configurator: Keyboard configuration UI

VIA : https://caniusevia.com/

safijari/keyboard_firmware_gen

  • looks like basic firmware is actually pretty simple (based on arduino keyboard.h)
  • My dumb little firmware generator is functionally complete now : ErgoMechKeyboards
  • Question about how serial or i2c comms are handled : ErgoMechKeyboards

Tags: kbd