~mlb/gergo_replicant

6b81aca4324a47ddc9ccb6b22cabd7a7a53eca10 — Matías Larre Borges 1 year, 10 months ago a066bbb
Add leader key mapping
3 files changed, 30 insertions(+), 9 deletions(-)

M config.h
M keymap.c
M rules.mk
M config.h => config.h +5 -0
@@ 1,3 1,8 @@
#pragma once

#define IGNORE_MOD_TAP_INTERRUPT

// Sets the timeout for the KC_LEAD key
#define LEADER_TIMEOUT 300
// Resets the timeout after each key is tapped
#define LEADER_PER_KEY_TIMING

M keymap.c => keymap.c +24 -9
@@ 22,10 22,11 @@ enum customKeycodes {
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap 0: Basic layer
 *
 *
 * ,-------------------------------------------.                         ,-------------------------------------------.
 * | L1/ESC |   Q  |   W  |   E  |   R  |   T  |                         |   Y  |   U  |   I  |   O  |   P  |  \ |   |
 * |--------+------+------+------+------+------|------.           .------|------+------+------+------+------+--------|
 * |Ctrl/TAB|   A  |   S  |  D   |   F  |   G  | ` ~  |           |      |   H  |   J  |   K  |   L  | ;  : |  ' "   |
 * |Ctrl/TAB|   A  |   S  |  D   |   F  |   G  | ` ~  |           | LEAD |   H  |   J  |   K  |   L  | ;  : |  ' "   |
 * |--------+------+------+------+------+------|------|           |------|------+------+------+------+------+--------|
 * | LShift |   Z  |   X  |   C  |   V  |   B  | ` ~  |           |      |   N  |   M  | ,  < | . >  | /  ? |  - _   |
 * `--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'


@@ 41,11 42,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
 *                                 `--------------'                      `--------------'
 */
[BASE] = LAYOUT_gergo(
    LT(NUMB, KC_ESC),       KC_Q,  KC_W,   KC_E,   KC_R, KC_T,                                          KC_Y,    KC_U, KC_I, KC_O,   KC_P,    KC_BSLS,
    MT(MOD_LCTL, KC_TAB),  KC_A,  KC_S,   KC_D,   KC_F, KC_G, KC_GRAVE,                       KC_TRNS,  KC_H,    KC_J, KC_K, KC_L,   KC_SCLN, KC_QUOT,
    KC_RSFT,                KC_Z,  KC_X,   KC_C,   KC_V, KC_B, KC_GRAVE, KC_BTN3,     KC_PGDN, KC_BSPC,  KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_MINS,
  MT(MOD_LGUI, KC_DEL), MT(MOD_LALT, KC_ENT), LT(NUMB, KC_SPC), LT(SYMB, KC_ESC),    LT(SYMB, KC_TAB), LT(NUMB, KC_ENT), KC_SPC, KC_BSPC
    ),
LT(NUMB, KC_ESC)   , KC_Q,  KC_W,   KC_E,   KC_R, KC_T,                                                      KC_Y,   KC_U,    KC_I,    KC_O,    KC_P, KC_BSLS,
MT(MOD_LCTL, KC_TAB), KC_A,  KC_S,   KC_D,   KC_F, KC_G, KC_GRAVE,                                 KC_DEL,    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_GRAVE, KC_BTN3,               KC_PGDN, KC_BSPC,   KC_N,   KC_M, KC_COMM,  KC_DOT, KC_SLSH, KC_MINS,
MT(MOD_LGUI, KC_DEL), MT(MOD_LALT, KC_ENT), LT(SYMB, KC_SPC), KC_LEAD,           LM(NUMB, MOD_LGUI), LT(NUMB, KC_ENT), KC_SPC, KC_BSPC
),
/* Keymap 1: Symbols layer
 *
 * ,-------------------------------------------.                         ,-------------------------------------------.


@@ 77,9 78,9 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
 * ,-------------------------------------------.                         ,-------------------------------------------.
 * |        |   1  |  2   |  3   |  4   |  5   |                         |  6   |  7   |  8   |  9   |  0   |        |
 * |--------+------+------+------+------+------|------.           .------|------+------+------+------+------+--------|
 * |  F1    |  F2  | F3   | F4   | F5   | F6   | BTN1 |           |      | LEFT | DOWN |  UP  | RIGHT|VolDn | VolUp  |
 * |        |  F1  | F2   | F3   | F4   | F5   | F6   |           |      | LEFT | DOWN |  UP  | RIGHT|VolDn | VolUp  |
 * |--------+------+------+------+------+------|------|           |------|------+------+------+------+------+--------|
 * |  F7    |  F8  | F9   | F10  | F11  | F12  | BTN2 |           |      | MLFT | MDWN | MUP  | MRGHT|Ply/Pa|  Skip  |
 * |        |  F7  | F8   | F9   | F10  | F11  | F12  |           |      | MLFT | MDWN | MUP  | MRGHT|Ply/Pa|  Skip  |
 * `--------+------+------+------+------+-------------'           `-------------+------+------+------+------+--------'
 *                        .------.   .------.                                 .------.   .-----.
 *                        |      |   |      |                                 |      |   |     |


@@ 96,7 97,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
    KC_TRNS, KC_1, 	  KC_2,    KC_3,    KC_4,    KC_5,                                             KC_6,    KC_7,    KC_8,    KC_9,    KC_0,    KC_TRNS,
    KC_TRNS, KC_F1,   KC_F2,   KC_F3,   KC_F4,   KC_F5,   KC_F6,                         KC_TRNS,  KC_LEFT, KC_DOWN, KC_UP,   KC_RGHT, KC_VOLD, KC_VOLU,
    KC_TRNS, KC_F7,   KC_F8,   KC_F9,   KC_F10,  KC_F11,  KC_F12,  KC_TRNS,     KC_TRNS, KC_TRNS,  KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_MPLY, KC_MNXT,
                                        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,         KC_TRNS,  KC_TRNS, KC_TRNS, KC_TRNS
                                        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,     KC_TRNS,  KC_TRNS, KC_TRNS, KC_TRNS
    ),
};



@@ 126,3 127,17 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
                                        KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,         KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS
    )
 */

LEADER_EXTERNS();

void matrix_scan_user(void) {
  LEADER_DICTIONARY() {
    leading = false;
    leader_end();

    // nooooooooooooooo
    SEQ_TWO_KEYS(KC_N, KC_O) {
      SEND_STRING("http://www.nooooooooooooooo.com/");
    }
  }
}

M rules.mk => rules.mk +1 -0
@@ 7,6 7,7 @@ BALLER = no 			# Enable to ball out
BALLSTEP = 20  			# Multiple in px to move, multiplied by layer number
SCROLLSTEP = 1 			# Lines to scroll with ball
MOUSEKEY_ENABLE = yes  		# Mouse keys, needed for baller
LEADER_ENABLE = yes 	# Enable leader key

#Debug options
VERBOSE 		 = yes