Reducing Skip Bigrams Strain

Custom QMK feature

tldr implementation here:
https://github.com/anantoghosh/My-QMK/blob/ananto-lily58/keyboards/lily58/rev1/keymaps/vial/skip_bigrams.c

If you're an avid typist, particularly if you use a keyboard layout that involves frequent same-finger bigrams or same-finger skip bigrams (typing keys with the same finger), you're probably familiar with the strain it can put on your fingers. Excessive finger movement can lead to fatigue and potential discomfort over extended typing sessions.

For example, in the handsdown neu layout

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

Looking at the MNL column, typing the letters ML requires quick single finger movement over two row keys (2u).
Such that typing words like
LAMB, MALL, MEAL, MILK, MELLOW, LAME, LIME require too much movement.

For consecutive keys, such as in the word CALMLY, handsdown neu solves it with adaptive keys. But this does not work for skip bigrams, i.e. bigrams separated by other letters.

To find out which skip bigrams affect you, test your layout in https://cyanophage.github.io/.

For example, the main skip bigrams that affect colemak-dh are

Implementing a solution

Let's say you have a keyboard layout with a column like this:

M
N
L

If you need to type ML MAL MEAL LAME etc., your finger would typically need to move the distance of two rows quickly. With this feature, you can define (M, L) as a skip_bigram_pair and a BIGRAM_KEY which on press types the other bigram letter. For example, typing:

  • M > BIGRAM_KEY will type "ML"

  • M > A > BIGRAM_KEY will type "MAL"

  • M > E > A > BIGRAM_KEY will type "MEAL"

  • M > A > BIGRAM_KEY > BIGRAM_KEY will type "MALL"

While this feature also works for regular bigrams, using adaptive keys may be a better solution for it.

How Does It Work?

The Skip Bigrams feature works by defining a BIGRAM_KEY that will type the separated letter when pressed after the first letter of a defined bigram pair. Here's how it works:

  1. Define an array of skip_bigram_pairs in your keymap file.

  2. Define a BIGRAM_KEY keycode, which you can place in a less-used position on your keyboard layout.

  3. When you type the first key of a defined bigram pair, the bigram mode is activated.

  4. In bigram mode, any vowels (a, e, i, o, u, y) or other specified "ignore letters" can be typed without affecting the bigram mode.

  5. When you press the BIGRAM_KEY, it will type the second letter of the current bigram pair, effectively skipping the need to move your finger to that key.

Customization

This implementation allows you to tailor the Skip Bigrams feature to your specific keyboard layout and typing habits.

  • You can define any pair of keys as skip_bigram_pairs. It may not be in the same column.

  • You can additionally use it decrease Lateral finger stretch or even regular same finger bigrams.

  • By default, it only skips over vowels + y, but it can be changed to ignore all home row keys as well, such that in the MNL stack you can type M > O > N > BIGRAM_KEY to type MONL, for e.g.. in the word commonly.

How to use

  1. Simply copy the code from the provided source file (skip_bigrams.c, `skip_bigrams.h` ) into your folder

    1. skip_bigrams.c

    2. skip_bigrams.h

  2. In the skip_bigrams.c file, define your desired skip_bigram_pairs and BIGRAM_KEY (default KC_F17), and update your layout to contain the BIGRAM_KEY

  3. Update your rules.mk to include

    1.   SRC += skip_bigrams.c
      
  4. Hook it up in your process_record_user function in keymap.c

    1.   #include "skip_bigrams.h"
      
        bool process_record_user(uint16_t keycode, keyrecord_t *record) {
            if(!process_skip_bigrams(keycode, record)) {
                return false;
            }
        }
      

Happy typing!