Table of Contents

Introduction

This post assumes familiarity with alternative keyboard layouts and magic keys. For further reading, check out layout.wiki’s excellent introduction to alternative keyboard layouts, as well as their overview on magic.

Adaptive swaps are a class of magic that follow the following rule:

Immediately after hitting key X, swap the positions of keys Y and Z.

Adaptive swaps do not require a dedicated key, so they can be used comfortably on a traditional rowstagger board. Moreover, unlike traditional magic, they can also be used to fix multiple bigrams with the same starting character.

As a motivating example, consider the popular layout Gallium (modded for column stagger) with a magic key added to the right thumb:

b l d w z  j y o u .
n r t s g  p h a e i 
x q m c v  k f ' / ,
             *

Traditional magic keys operate on the rule x* -> xy, meaning that after hitting the X key, hitting the magic key will produce Y.

Gallium has a number of common SFB’s concentrated on the index fingers. Consider the following SFB’s in particular on the left index finger:

  • sc as in science
  • sw as in switch
  • ss as in mass

All three are high-value bigrams to fix, but only one can be addressed with a magic rule eg s* -> sc when using traditional magic keys. Because of this, Gallium is not considered to benefit much from magic.

By comparison, adaptive swaps can address both sc and sw bigrams, leaving the magic key free to act as a repeat key for ss. This particular example will be discussed in more detail below.

On notation: adaptive swaps will be described as either xy xz when used in a paragraph, or [X, Y, Z] when used in a code block.

Prior art

Adaptive keys are also used in the Hands Down community. In their implementation however, instead of doing a swap with the fixer key, they fully override the fixer with no swap. This means that to access the key being overridden, you must wait for a timeout.

A distinct advantage of the adaptive swaps described here is that the both sides of the swap are accessible at all times. Returning to Gallium, sc can be fixed with an sc sd rule. If you need to type sd, like in SDK, that can still be typed without waiting for timeouts by hitting the physical keys SCK.

Learning adaptive swaps

Learning the “good side” of an adaptive swap tends not to be too challenging, as adaptive swaps are always active and will result in a typo if not used. In particular, if an adaptive swap results in a roll such as with sc sd, it is usually picked up relatively quickly.

Learning the “bad side” of the swap takes more time. For uncommon bigrams like sd, you may not see it often enough in everyday typing to learn it effectively. Depending on how confident you need to be in the bigram, you may need to train it specifically.

Examples

The examples below show how adaptive swaps can be applied to two of the most popular modern layouts. More in-depth layout examples are shown at the bottom of this page in the Layout Appendix.

Adaptive Gallium (Colstag)

The layout Gallium from above has excellent LSB stats, but it also has a few common scissors and SFB’s that can be addressed with adaptive swaps.

b l d w z  j y o u .
n r t s g  p h a e i 
x q m c v  k f ' / ,

The following set of rules give the high return on investment without introducing too much complexity:

# SFB
- [U, E, O]
- [S, C, D]
  
# Comfort
- [B, R, D]
- [M, B, C]
  • ue uo turns the ue SFB in words like question into a same-row inroll.
  • sc sd turns the sc SFB in words like science into an outroll.
  • br bd turns the pinky-ring scissor in words like break into a same-row inroll.
  • mb mc turns the 2u middle-pinky scissor in words like thumb into a same-row inroll.

Adaptive Sturdy (Rowstag)

Sturdy has similar SFB stats to Gallium, but it suffers from higher LSBs due to its left index, as well as a common 2u ck scissor.

v m l c p  x f o u j 
s t r d y  . n a e i 
z k q g w  b h ' / ,

The following set of rules address those pain points.

# SFB
- [U, E, O]

# Comfort
- [P, L, N]
- [P, R, F]
- [L, Y, C]
- [C, K, M]

In addition to the same-hand swaps we saw above with Gallium, here we introduce two cross-hand swaps with pl pn and pr pf.

In general, cross-hand adaptive swaps tend to result in increased alternation, as you are changing hands to produce a bigram that was previously same-handed.

Interestingly though for Sturdy, these rules result in rolls on the vowel hand. Both pr and pl are usually followed by vowels, such as in the words play, professional, present, plot. This characteristic makes Sturdy particularly well suited for adaptive swaps.

Applying adaptive swaps to a new layout

There are a few guidelines for what makes a good adaptive swap. We will use continue using Gallium as our example layout.

Firstly, the fixer bigram needs to be uncommon. sd and sr are both good candidates to fix a bad s bigram due to their low frequency. By comparison, trying to fix an r* bigram is difficult, because r has common pairings with almost all letters.

Secondly, the good side of the swap must result in good trigrams. For example, mc could have been chosen to fix mb mc, but that would introduce a new SFB in words like thumbs.

In practice, it is difficult for swaps on the vowel side to meet these guidelines, as either all pairings will be common (swapping with a vowel), or the resulting trigram will be poor (contending with a vowel). On the other hand, swapping with a letter from the same column (such as solving the mb bigram using mb mx) will never result in a new SFB.

Layout Appendix

If the earlier examples were “lite” versions of adaptive swaps, then what follows are “full” versions of adaptive swaps.

These rules are all shown roughly in order of decreasing ROI. Unless otherwise specified, there is no need to adopt all of the rules shown for a given layout. Feel free to pick and choose as suits your style.

Adaptive Gallium (Colstag)

Layout:

b l d w z  j y o u .
n r t s g  p h a e i 
x q m c v  k f ' / ,

Rules:

##################################
# Same as Adaptive Gallium above #
##################################

# SFB
- [U, E, O]
- [S, C, D]
  
# Comfort 
- [B, R, D]
- [M, B, C]
  
####################
# Additional rules #
####################

# SFB
- [S, W, R]
- [C, S, N]
- [W, S, D]
- [R, L, X]

Adaptive Sturdy (Rowstag)

Layout:

v m l c p  x f o u j 
s t r d y  . n a e i 
z k q g w  b h ' / ,

Rules:

#################################
# Same as Adaptive Sturdy above #
#################################

# SFB
- [U, E, O]

# Comfort
- [P, L, N]
- [P, R, F]
- [L, Y, C]
- [C, K, M]
  
####################
# Additional rules #
####################

# SFB
- [P, Y, B]
- [N, F, R]
- [D, Y, T]
- [C, Y, V]
- [R, L, J]
- [G, Y, Q]

# Comfort
- [S, K, R]

Adaptive Sturdy (Colstag)

As of time of writing, this is my daily driver layout. The rules are almost identical to the rowstag version above, minus the change to the rl rule to accomodate the colstag right hand changes.

Layout:

v m l c p  j f o u . 
s t r d y  b n a e i 
z k q g w  x h ' - ,

Rules:

# SFB
- [U, E, O]
- [P, Y, B]
- [D, Y, T]
- [C, Y, V]
- [R, L, J]
- [G, Y, Q]

# Comfort
- [P, L, N]
- [P, R, F]
- [L, Y, C]
- [C, K, M]
- [S, K, R]

Vylet

Vylet is a layout made by Acas in 2024, recently revamped to eliminate its magic key in favor of adaptive swaps. Acas was also the first community member to try incorporating adaptive swaps into their layout after the introduction of Adaptive Sturdy.

Vylet, like Whirl, is notable in being a layout that depends on magic to be viable. This has continued into its transition to adaptive keys, marked as such in the rules section.

Layout:

w c m p k  x l o u j -
r s t h f  ' n a e i  
q g v d b  z y . ; ,  

Rules:

Vylet v4 adaptive swaps

# REQUIRED
- [L, Y, J]
- [N, L, B]
- [N, ', H]
- [N, Y, R]

# SLIDES (not necessary, but nice to have)
- [W, R, C]

# SCISSORS & LAT STRETCHES (lower value, but also nice)
- [G, R, V]
- [W, S, M]
- [M, B, C]
- [H, T, N]
More information on Vylet's adaptive swap rules

See the annotated rule list from the author:

Vylet v4 adaptive swaps

# SFBS (REQUIRED FOR LAYOUT TO NOT BE BAD)

    [L, Y, J]  ... SFB -> outroll
    [N, L, B]  ... SFB -> alternation
    [N, ', H]  ... SFB -> alternation, but very likely to be outroll afterwards (n't)
    [N, Y, R]  ... SFB -> alternation

# SLIDES

    [W, R, C]  ... SFB -> inroll

# SCISSORS, LAT STRETCHES, REDIRECTS

    [G, R, V]  ... SCISSOR -> inroll
    [W, S, M]  ... SCISSOR -> inroll
    [M, B, C]  ... LAT STRETCH -> outroll
    [H, T, N]  ... REDIRECT -> alternation

Whirl

Note that Whirl itself is already a magic layout. Adaptive swaps may relieve some of the required magic rules from Whirl’s thumb magic key, freeing it up to use for repeats.

Layout:

q g d f v  z l u o y
n s t h m  ' r e a i
b c p w k  x j . / ,
             *

Rules:

# SFB
- [U, E, O]
- [S, C, D]
- [G, S, D]
- [P, T, W]
  
# Comfort
- [C, K, P]