Skip to content

brotheramai/bigram

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Bigram

Simple qmk community module to add easy bigram support. You know, a bigram, like th or ck. This module automatically capitalizes the first letter when the shift key is held.

Ok, how?

First, you need to #define BIGRAM_MAX in your config.h file. Define BIGRAM_MAX to be big enough for however many bigrams you want to have in your layout.

#define BIGRAM_MAX 10

Now in your keymap.h define a custom keycode for each bigram that you want to type.

enum my_keycodes {
    BI_KN = SAFE_RANGE,
    BI_NK,
    BI_GH,
    BI_SH,
    BI_CH,
    BI_CY,
    BI_WH,
    BI_PH,
    BI_CK,
    BI_TH
};

Next define the bigrams themselves. To define a bigram first put the keycode that will trigger the bigram, then the keycode of the first letter, and then the keycode of the second letter.

const Bigram PROGMEM bigrams[BIGRAM_MAX] = {
    {BI_KN, KC_K, KC_N},
    {BI_NK, KC_N, KC_K},
    {BI_GH, KC_G, KC_H},
    {BI_SH, KC_S, KC_H},
    {BI_CH, KC_C, KC_H},
    {BI_CY, KC_C, KC_Y},
    {BI_WH, KC_W, KC_H},
    {BI_PH, KC_P, KC_H},
    {BI_CK, KC_C, KC_K},
    {BI_TH, KC_T, KC_H}
};

Finally add them to a layer somewhere and start typing away.

    ...
    /*     
     * ┌───┬───┬───┬───┬───┐              ┌───┬───┬───┬───┬───┐
     * │   │kn │nk │gh │   │              │   │ y │   │ j │   │
     * ├───┼───┼───┼───┼───┤              ├───┼───┼───┼───┼───┤
     * │   │sh │ch │cy │   │              │   │   │ h │   │   │
     * ├───┼───┼───┼───┼───┤              ├───┼───┼───┼───┼───┤
     * │   |wh │ph │ck │   │              │   │ k │ p │ q │   │
     * └───┴───┼───┼───┼───┤              ├───┼───┼───┼───┴───┘
     *         |   │th │   │              │^^^│ b │   |
     *         └───┴───┴───┘              └───┴───┴───┘
     */
    [ALPHA] = LAYOUT(
        KC_NO,    BI_KN,     BI_NK,       BI_GH,        KC_NO,                       KC_NO,    KC_Y,   KC_NO,       KC_J,    KC_NO,
        KC_NO,    BI_SH,     BI_CH,       BI_CY,        KC_NO,                       KC_NO,    KC_NO,  KC_H,        KC_NO,   KC_NO,
        KC_NO,    BI_WH,     BI_PH,       BI_CK,        _______,                     KC_N,     KC_K,   KC_P,        KC_Q,    KC_NO,
        KC_NO,    KC_NO,     TO(BASE),    KC_TH,        MT(MOD_LSFT,KC_ENTER),       KC_LSFT,  KC_B,   KC_NO,       KC_NO,   KC_NO
    ),
    ...

About

a qmk community module to add easy bigram support

Resources

Stars

Watchers

Forks

Releases

Packages

Contributors

Languages