1
0
Fork 0

heartrobotninja ergodox_ez and lets_split layouts (#1874)

This commit is contained in:
heartrobotninja 2017-10-21 12:59:31 -07:00 committed by Jack Humbert
parent 78923cb884
commit b25338a809
6 changed files with 999 additions and 0 deletions

View file

@ -0,0 +1,18 @@
#ifndef CONFIG_HEARTROBOTNINJA_H
#define CONFIG_HEARTROBOTNINJA_H
#include "../../config.h"
#define ONESHOT_TAP_TOGGLE 2
#define ONESHOT_TIMEOUT 1000
#undef LEADER_TIMEOUT
#define LEADER_TIMEOUT 1000
#undef TAPPING_TERM
#define TAPPING_TERM 200
#undef TAPPING_TOGGLE
#define TAPPING_TOGGLE 2
#endif

View file

@ -0,0 +1,680 @@
#include "action_layer.h"
#include "action_util.h"
#include "debug.h"
#include "eeconfig.h"
#include "ergodox_ez.h"
#include "version.h"
#include "wait.h"
/* Aliases */
#define ____ KC_TRNS
/* Layers */
enum
{
COLE = 0,
LOWER, // right hand 10 key
RAISE, // Function keys
AUX, // Things like rebooting the board to be flashed. NUM + RAISE
};
/* Macros */
enum
{
NONE = 0,
// OS Functions
F_PASTE,
// Config Macros
CF_EPRM,
CF_VERS,
// RGB Macro
RGB_ANI,
};
/* Tap Dancery */
enum
{
TD_BTK,
TD_TDE,
TD_LPRN,
TD_RPRN,
TD_MIN,
TD_USC,
TD_COPY,
TD_UNDO,
TD_FIND,
};
/* OS Identifier */
enum
{
OS_WIN = 0,
OS_OSX,
OS_LIN,
};
uint8_t os_type = OS_WIN;
static uint16_t rgb_timer;
bool time_travel = false;
bool skip_leds = false;
/* Keymaps */
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Keymap 0: Colemak Layer
*
* ,-----------------------------------------------------. ,-----------------------------------------------------.
* | Find | 1 ! | 2 @ | 3 # | 4 $ | 5 % | Undo | | VOLUP| 6 ^ | 7 & | 8 * | 9 ( | 0 ) | ---- |
* | | | | | | | | | | | | | | | |
* |-----------+------+------+------+------+------+------| |------+------+------+------+------+------+-----------|
* | ' " ` | Q | W | F | P | G | CCopy| | VOLDN| J | L | U Ü | Y | = + | ~ : ; |
* |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------|
* | ( [ { | A Ä | R | S ß | T | D |------| |------| H | N | E | I | O Ö | ) ] } |
* |-----------+------+------+------+------+------| Paste| | MUTE |------+------+------+------+------+-----------|
* | - , < | Z | X | C | V | B | | | | K | M | / ? | \ | | ^ | _ . > |
* `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------'
* | AUX | RAISE | LOWER | LEAD | GUI | | ESC | LOCK | < | v | > |
* `-----------------------------------' `-----------------------------------'
* ,-------------. ,-------------.
* | ALT | CTRL | | HOME | END |
* ,------|------|------| |------+------+------.
* | | | Del | | PGUP | | |
* | Space|Backsp|------| |------| Enter| Shift|
* | | | Tab | | PGDN | | |
* `--------------------' `--------------------'
*/
[COLE] = KEYMAP(
// Left Hand
TD(TD_FIND), KC_1, KC_2, KC_3, KC_4, KC_5, TD(TD_UNDO),
TD(TD_BTK), KC_Q, KC_W, KC_F, KC_P, KC_G, TD(TD_COPY),
TD(TD_LPRN), KC_A, KC_R, KC_S, KC_T, KC_D,
TD(TD_MIN), KC_Z, KC_X, KC_C, KC_V, KC_B, M(F_PASTE),
TT(AUX), TT(RAISE), TT(LOWER), KC_LEAD, OSM(MOD_LGUI),
OSM(MOD_LALT), OSM(MOD_LCTL),
KC_DEL,
KC_SPC, KC_BSPC, KC_TAB,
// Right Hand
KC_VOLU, KC_6, KC_7, KC_8, KC_9, KC_0, ____,
KC_VOLD, KC_J, KC_L, KC_U, KC_Y, KC_MINS, TD(TD_TDE),
KC_H, KC_N, KC_E, KC_I, KC_O, TD(TD_RPRN),
KC_MUTE, KC_K, KC_M, KC_SLSH, KC_BSLS, KC_UP, TD(TD_USC),
KC_ESC, LGUI(KC_L), KC_LEFT, KC_DOWN, KC_RGHT,
KC_HOME, KC_END,
KC_PGUP,
KC_PGDOWN, KC_ENT, OSM(MOD_LSFT)),
/* Keymap 2: LOWER Layer
*
* ,-----------------------------------------------------. ,-----------------------------------------------------.
* | ---- | ---- | ---- | ---- | ---- | ---- | | | | ( | ) | ^ | / | ---- | |
* | | | | | | | ---- | | ---- | | | | | | ---- |
* |-----------+------+------+------+------+------+------| |------+------+------+------+------+------+-----------|
* | ---- | ---- | ---- | ---- | ---- | ---- | | | | 7 | 8 | 9 | * | ---- | ---- |
* |-----------+------+------+------+------+------| ---- | | ---- |------+------+------+------+------+-----------|
* | ---- | ---- | ---- | ---- | ---- | ---- |------| |------| 4 | 5 | 6 | - | ---- | ---- |
* |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------|
* | ---- | ---- | ---- | ---- | ---- | ---- | ---- | | ---- | 1 | 2 | 3 | + | ---- | ---- |
* `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------'
* | ---- | ---- | ---- | ---- | ---- | | 0 | = | ---- | ---- | ---- |
* `-----------------------------------' `-------------------------------------'
* ,-------------. ,-------------.
* | ---- | ---- | | ---- | ---- |
* ,------|------|------| |------+------+------.
* | | | ---- | | ---- | | |
* | ---- | ---- |------| |------| ---- | ---- |
* | | | ---- | | ---- | | |
* `--------------------' `--------------------'
*/
[LOWER] = KEYMAP(
// Left Hand
____, ____, ____, ____, ____, ____, ____,
____, ____, ____, ____, ____, ____, ____,
____, ____, ____, ____, ____, ____,
____, ____, ____, ____, ____, ____, ____,
____, ____, ____, ____, ____,
____, ____,
____,
____, ____, ____,
// Right Hand
____, KC_LPRN, KC_RPRN, KC_CIRC, KC_PSLS, ____, ____,
____, KC_7, KC_8, KC_9, KC_PAST, ____, ____,
KC_4, KC_5, KC_6, KC_PMNS, ____, ____,
____, KC_1, KC_2, KC_3, KC_PPLS, ____, ____,
KC_0, KC_PEQL, ____, ____, ____,
____, ____,
____,
____, ____, ____),
/* Keymap 3: RAISE Layer
*
* ,-----------------------------------------------------. ,-----------------------------------------------------.
* | F1 | F2 | F3 | F4 | F5 | F6 | ---- | | ---- | ! | @ | # | $ | % | ` ~ |
* | | | | | | | | | | | | | | | |
* |-----------+------+------+------+------+------+------| |------+------+------+------+------+------+-----------|
* | F7 | F8 | F9 | F10 | F11 | F12 | ---- | | ---- | ^ | & | * | ( | ) | - _ |
* |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------|
* | ---- | ---- | ---- | ---- | ---- | ---- |------| |------| [ { | } ] | \ | | ; : | ' " | = + |
* |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------|
* | ---- | ---- | ---- | ---- | ---- | ---- | ---- | | ---- | , < | > . | / ? | ---- | ---- | ---- |
* `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------'
* | ---- | ---- | ---- | ---- | ---- | | ---- | ---- | ---- | ---- | ---- |
* `-----------------------------------' `-----------------------------------'
* ,-------------. ,-------------.
* | ---- | ---- | | ---- | ---- |
* ,------|------|------| |------+------+------.
* | | | ---- | | ---- | | |
* | ---- | ---- |------| |------| ---- | ---- |
* | | | ---- | | ---- | | |
* `--------------------' `--------------------'
*/
[RAISE] = KEYMAP(
// Left Hand
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, ____,
KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, ____,
____, ____, ____, ____, ____, ____,
____, ____, ____, ____, ____, ____, ____,
____, ____, ____, ____, ____,
____, ____,
____,
____, ____, ____,
// Right Hand
____, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_GRV,
____, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_MINS,
KC_LBRC, KC_RBRC, KC_BSLS, KC_SCLN, KC_QUOT, KC_EQL,
____, KC_COMM, KC_DOT, KC_SLSH, ____, ____, ____,
____, ____, ____, ____, ____,
____, ____,
____,
____, ____, ____),
/* Keymap 7: Configuration Layer
*
* ,-----------------------------------------------------. ,-----------------------------------------------------.
* | EEPROM | ---- | ---- | ---- | ---- | ---- | ---- | | PWR | ---- | ---- | ---- | ---- | ---- | |
* | | | | | | | | | | | | | | | VERSION |
* |-----------+------+------+------+------+------+------| |------+------+------+------+------+------+-----------|
* | ---- | ---- | ---- | ---- | ---- | ---- | | | | ---- | ---- | ---- | ---- | ---- | ---- |
* |-----------+------+------+------+------+------| ---- | | SLP |------+------+------+------+------+-----------|
* | ---- | ---- | ---- | ---- | ---- | ---- |------| |------| ---- | ---- | ---- | ---- | ---- | ---- |
* |-----------+------+------+------+------+------| | | |------+------+------+------+------+-----------|
* | ---- | ---- | ---- | ---- | ---- | ---- | ---- | | WAKE | ---- | ---- | ---- | ---- | ---- | ---- |
* `-----------+------+------+------+------+-------------' `-------------+------+------+------+------+-----------'
* | ---- | ---- | ---- | ---- | ---- | | ---- | ---- | ---- | ---- | ---- |
* `-----------------------------------' `-----------------------------------'
* ,-------------. ,-------------.
* | ---- | ---- | | TOG | ANI |
* ,------|------|------| |------+------+------.
* | | | ---- | | VAI | | |
* | ---- | ---- |------| |------| HUI | HUID |
* | | | ---- | | VAD | | |
* `--------------------' `--------------------'
*/
[AUX] = KEYMAP(
// Left Hand
M(CF_EPRM), ____, ____, ____, ____, ____, KC_PWR,
____, ____, ____, ____, ____, ____, KC_SLEP,
____, ____, ____, ____, ____, ____,
____, ____, ____, ____, ____, ____, KC_WAKE,
____, ____, ____, ____, ____,
____, ____,
____,
____, ____, ____,
// Right Hand
KC_PWR, ____, ____, ____, ____, ____, M(CF_VERS),
KC_SLEP, ____, ____, ____, ____, ____, ____,
____, ____, ____, ____, ____, ____,
KC_WAKE, ____, ____, ____, ____, ____, ____,
____, ____, ____, ____, ____,
RGB_TOG, M(RGB_ANI),
RGB_VAI,
RGB_VAD, RGB_HUI, RGB_HUD),
};
void unredo(qk_tap_dance_state_t *state, void *user_data)
{
if (state->count > 1)
{
register_code(KC_LCTL);
register_code(KC_Y);
unregister_code(KC_Y);
unregister_code(KC_LCTL);
}
else
{
register_code(KC_LCTL);
register_code(KC_Z);
unregister_code(KC_Z);
unregister_code(KC_LCTL);
}
reset_tap_dance(state);
}
void ccopy(qk_tap_dance_state_t *state, void *user_data)
{
if (state->count > 1)
{
register_code(KC_LCTL);
register_code(KC_X);
unregister_code(KC_X);
unregister_code(KC_LCTL);
}
else
{
register_code(KC_LCTL);
register_code(KC_C);
unregister_code(KC_C);
unregister_code(KC_LCTL);
}
reset_tap_dance(state);
}
void findreplace(qk_tap_dance_state_t *state, void *user_data)
{
if (state->count > 1)
{
register_code(KC_LCTL);
register_code(KC_H);
unregister_code(KC_H);
unregister_code(KC_LCTL);
}
else
{
register_code(KC_LCTL);
register_code(KC_F);
unregister_code(KC_F);
unregister_code(KC_LCTL);
}
reset_tap_dance(state);
}
qk_tap_dance_action_t tap_dance_actions[] = {
[TD_BTK] = ACTION_TAP_DANCE_DOUBLE(KC_QUOT, KC_GRV),
[TD_TDE] = ACTION_TAP_DANCE_DOUBLE(KC_SCLN, KC_TILD),
[TD_LPRN] = ACTION_TAP_DANCE_DOUBLE(KC_LBRC, KC_LPRN),
[TD_RPRN] = ACTION_TAP_DANCE_DOUBLE(KC_RBRC, KC_RPRN),
[TD_MIN] = ACTION_TAP_DANCE_DOUBLE(KC_COMM, KC_MINS),
[TD_USC] = ACTION_TAP_DANCE_DOUBLE(KC_DOT, KC_UNDS),
[TD_COPY] = ACTION_TAP_DANCE_FN(ccopy),
[TD_UNDO] = ACTION_TAP_DANCE_FN(unredo),
[TD_FIND] = ACTION_TAP_DANCE_FN(findreplace)};
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{
switch (id)
{
case F_PASTE:
if (record->event.pressed)
{
register_code(KC_LCTL);
register_code(KC_V);
unregister_code(KC_V);
unregister_code(KC_LCTL);
}
break;
case RGB_ANI:
if (record->event.pressed)
{
rgb_timer = timer_read();
}
else
{
if (timer_elapsed(rgb_timer) > 300)
{
rgblight_mode(1);
}
else
{
rgblight_step();
}
}
case CF_EPRM:
if (record->event.pressed)
{
eeconfig_init();
}
return false;
break;
case CF_VERS:
if (record->event.pressed)
{
SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
}
return false;
break;
}
return MACRO_NONE;
};
/*
bool process_record_user(uint16_t keycode, keyrecord_t *record)
{}
*/
void tap(uint16_t code)
{
register_code(code);
unregister_code(code);
}
LEADER_EXTERNS();
void matrix_scan_user(void)
{
uint8_t layer = biton32(layer_state);
if (keyboard_report->mods & MOD_BIT(KC_LSFT) ||
((get_oneshot_mods() & MOD_BIT(KC_LSFT)) &&
!has_oneshot_mods_timed_out()))
{
ergodox_right_led_1_set(LED_BRIGHTNESS_HI);
ergodox_right_led_1_on();
}
else if (layer == RAISE || layer == AUX)
{
ergodox_right_led_1_set(LED_BRIGHTNESS_LO);
ergodox_right_led_1_on();
}
else
{
ergodox_right_led_1_off();
}
if (keyboard_report->mods & MOD_BIT(KC_LCTL) ||
((get_oneshot_mods() & MOD_BIT(KC_LCTL)) &&
!has_oneshot_mods_timed_out()))
{
ergodox_right_led_2_set(LED_BRIGHTNESS_HI);
ergodox_right_led_2_on();
}
else if (layer == LOWER || layer == AUX)
{
ergodox_right_led_2_set(LED_BRIGHTNESS_LO);
ergodox_right_led_2_on();
}
else
{
ergodox_right_led_2_off();
}
if (keyboard_report->mods & MOD_BIT(KC_LALT) ||
((get_oneshot_mods() & MOD_BIT(KC_LALT)) &&
!has_oneshot_mods_timed_out()))
{
ergodox_right_led_3_set(LED_BRIGHTNESS_HI);
ergodox_right_led_3_on();
}
else if (layer == COLE || layer == AUX)
{
ergodox_right_led_3_set(LED_BRIGHTNESS_LO);
ergodox_right_led_3_on();
}
else
{
ergodox_right_led_3_off();
}
LEADER_DICTIONARY()
{
leading = false;
leader_end();
SEQ_THREE_KEYS(KC_W, KC_I, KC_N) { os_type = OS_WIN; };
SEQ_THREE_KEYS(KC_O, KC_S, KC_X) { os_type = OS_OSX; };
SEQ_THREE_KEYS(KC_L, KC_I, KC_N) { os_type = OS_LIN; };
SEQ_ONE_KEY(KC_A)
{
switch (os_type)
{
case OS_WIN:
tap(KC_NLCK);
register_code(KC_RALT);
tap(KC_KP_0);
tap(KC_KP_2);
tap(KC_KP_2);
tap(KC_KP_8);
unregister_code(KC_RALT);
tap(KC_NLCK);
break;
case OS_OSX:
register_code(KC_RALT);
register_code(KC_RSFT);
register_code(KC_SCLN);
unregister_code(KC_SCLN);
unregister_code(KC_RSFT);
unregister_code(KC_RALT);
tap(KC_A);
break;
case OS_LIN:
tap(KC_RALT);
tap(KC_DQT);
tap(KC_A);
break;
}
}
SEQ_TWO_KEYS(KC_A, KC_A)
{
switch (os_type)
{
case OS_WIN:
tap(KC_NLCK);
register_code(KC_RALT);
tap(KC_KP_0);
tap(KC_KP_1);
tap(KC_KP_9);
tap(KC_KP_6);
unregister_code(KC_RALT);
tap(KC_NLCK);
break;
case OS_OSX:
register_code(KC_RALT);
register_code(KC_RSFT);
register_code(KC_SCLN);
unregister_code(KC_SCLN);
unregister_code(KC_RSFT);
unregister_code(KC_RALT);
register_code(KC_LSFT);
register_code(KC_A);
unregister_code(KC_A);
unregister_code(KC_LSFT);
break;
case OS_LIN:
tap(KC_RALT);
tap(KC_DQT);
register_code(KC_LSFT);
register_code(KC_A);
unregister_code(KC_A);
unregister_code(KC_LSFT);
break;
}
}
SEQ_ONE_KEY(KC_O)
{
switch (os_type)
{
case OS_WIN:
tap(KC_NLCK);
register_code(KC_RALT);
tap(KC_KP_0);
tap(KC_KP_2);
tap(KC_KP_4);
tap(KC_KP_6);
unregister_code(KC_RALT);
tap(KC_NLCK);
break;
case OS_OSX:
register_code(KC_RALT);
register_code(KC_RSFT);
register_code(KC_SCLN);
unregister_code(KC_SCLN);
unregister_code(KC_RSFT);
unregister_code(KC_RALT);
tap(KC_O);
break;
case OS_LIN:
tap(KC_RALT);
tap(KC_DQT);
tap(KC_O);
break;
}
}
SEQ_TWO_KEYS(KC_O, KC_O)
{
switch (os_type)
{
case OS_WIN:
tap(KC_NLCK);
register_code(KC_RALT);
tap(KC_KP_0);
tap(KC_KP_2);
tap(KC_KP_1);
tap(KC_KP_4);
unregister_code(KC_RALT);
tap(KC_NLCK);
break;
case OS_OSX:
register_code(KC_RALT);
register_code(KC_RSFT);
register_code(KC_SCLN);
unregister_code(KC_SCLN);
unregister_code(KC_RSFT);
unregister_code(KC_RALT);
tap(LSFT(KC_O));
break;
case OS_LIN:
tap(KC_RALT);
tap(KC_DQT);
register_code(KC_LSFT);
register_code(KC_O);
unregister_code(KC_O);
unregister_code(KC_LSFT);
break;
}
}
SEQ_ONE_KEY(KC_U)
{
switch (os_type)
{
case OS_WIN:
tap(KC_NLCK);
register_code(KC_RALT);
tap(KC_KP_0);
tap(KC_KP_2);
tap(KC_KP_5);
tap(KC_KP_2);
unregister_code(KC_RALT);
tap(KC_NLCK);
break;
case OS_OSX:
register_code(KC_RALT);
register_code(KC_RSFT);
register_code(KC_SCLN);
unregister_code(KC_SCLN);
unregister_code(KC_RSFT);
unregister_code(KC_RALT);
tap(KC_U);
break;
case OS_LIN:
tap(KC_RALT);
tap(KC_DQT);
tap(KC_U);
break;
}
}
SEQ_TWO_KEYS(KC_U, KC_U)
{
switch (os_type)
{
case OS_WIN:
tap(KC_NLCK);
register_code(KC_RALT);
tap(KC_KP_0);
tap(KC_KP_2);
tap(KC_KP_2);
tap(KC_KP_0);
unregister_code(KC_RALT);
tap(KC_NLCK);
break;
case OS_OSX:
register_code(KC_RALT);
register_code(KC_RSFT);
register_code(KC_SCLN);
unregister_code(KC_SCLN);
unregister_code(KC_RSFT);
unregister_code(KC_RALT);
tap(LSFT(KC_U));
break;
case OS_LIN:
tap(KC_RALT);
tap(KC_DQT);
register_code(KC_LSFT);
register_code(KC_U);
unregister_code(KC_U);
unregister_code(KC_LSFT);
break;
}
}
SEQ_ONE_KEY(KC_S)
{
switch (os_type)
{
case OS_WIN:
tap(KC_NLCK);
register_code(KC_RALT);
tap(KC_KP_0);
tap(KC_KP_2);
tap(KC_KP_2);
tap(KC_KP_3);
unregister_code(KC_RALT);
tap(KC_NLCK);
break;
case OS_OSX:
register_code(KC_RALT);
tap(KC_S);
unregister_code(KC_RALT);
break;
case OS_LIN:
tap(KC_RALT);
tap(KC_S);
tap(KC_S);
break;
}
}
}
}
void matrix_init_user(void)
{
ergodox_led_all_on();
rgblight_init();
rgblight_enable();
rgblight_setrgb(255, 0, 0);
for (int i = LED_BRIGHTNESS_HI; i > LED_BRIGHTNESS_LO; i--)
{
ergodox_led_all_set(i);
wait_ms(5);
}
rgblight_setrgb(255, 255, 0);
wait_ms(1000);
for (int i = LED_BRIGHTNESS_LO; i > 0; i--)
{
ergodox_led_all_set(i);
wait_ms(10);
}
rgblight_setrgb(0, 255, 255);
ergodox_led_all_off();
wait_ms(1000);
rgblight_effect_knight(50);
}

View file

@ -0,0 +1,34 @@
BOOTMAGIC_ENABLE=no
COMMAND_ENABLE=no
SLEEP_LED_ENABLE=no
NKRO_ENABLE = yes
FORCE_NKRO = no
DEBUG_ENABLE = no
CONSOLE_ENABLE = no
TAP_DANCE_ENABLE = yes
KEYLOGGER_ENABLE = no
UCIS_ENABLE = no
MOUSEKEY_ENABLE = no
AUTOLOG_ENABLE = no
RGBLIGHT_ENABLE = yes
RGBLIGHT_ANIMATION = yes
EXTRAKEY_ENABLE = yes
OPT_DEFS += -DUSER_PRINT
KEYMAP_VERSION = $(shell \
if [ -d "${KEYMAP_PATH}/.git" ]; then \
cd "${KEYMAP_PATH}" && git describe --abbrev=6 --dirty --always --tags --match 'v*' 2>/dev/null; \
else echo QMK; fi)
KEYMAP_BRANCH = $(shell \
if [ -d "${KEYMAP_PATH}/.git" ]; then \
cd "${KEYMAP_PATH}"; \
fi; \
git rev-parse --abbrev-ref HEAD 2>/dev/null)
OPT_DEFS += -DKEYMAP_VERSION=\"$(KEYMAP_VERSION)\\\#$(KEYMAP_BRANCH)\"
ifndef QUANTUM_DIR
include ../../../../Makefile
endif

View file

@ -0,0 +1,58 @@
/*
This is the c configuration file for the keymap
Copyright 2012 Jun Wako <wakojun@gmail.com>
Copyright 2015 Jack Humbert
This program is free software: you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation, either version 2 of the License, or
(at your option) any later version.
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
You should have received a copy of the GNU General Public License
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
#ifndef CONFIG_USER_H
#define CONFIG_USER_H
#include "../../config.h"
/* Use I2C or Serial, not both */
#define USE_SERIAL
/* Select hand configuration */
// #define MASTER_LEFT
// #define MASTER_RIGHT
#define EE_HANDS
#define ONESHOT_TAP_TOGGLE 2
#define ONESHOT_TIMEOUT 1000
#undef LEADER_TIMEOUT
#define LEADER_TIMEOUT 1000
#undef TAPPING_TERM
#define TAPPING_TERM 200
#undef TAPPING_TOGGLE
#define TAPPING_TOGGLE 2
#ifdef SUBPROJECT_rev1
#include "../../rev1/config.h"
#endif
#ifdef SUBPROJECT_rev2
#include "../../rev2/config.h"
#endif
#ifdef SUBPROJECT_rev2fliphalf
#include "../../rev2fliphalf/config.h"
#endif
#endif

View file

@ -0,0 +1,183 @@
#include "lets_split.h"
#include "action_layer.h"
#include "action_util.h"
#include "debug.h"
#include "eeconfig.h"
extern keymap_config_t keymap_config;
// Each layer gets a name for readability, which is then used in the keymap matrix below.
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
// Layer names don't all need to be of the same length, obviously, and you can also skip them
// entirely and just use numbers.
#define _COLE 0
#define _LOWER 1
#define _RAISE 2
#define _AUX 16
/* Layers */
enum
{
COLE = 0,
LOWER, // right hand 10 key.
RAISE, // left hand Fn, right hand symbols.
AUX,
};
/* Tap Dancery */
enum
{
TD_BTK,
TD_TDE,
TD_LPRN,
TD_RPRN,
TD_MIN,
TD_USC,
};
bool time_travel = false;
// Fillers to make layering more clear
#define ____ KC_TRNS
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Colemak
* ,-----------------------------------------------------------------------------------.
* | ' " `| Q | W | F | P | G | J | L | U | Y | = + | ~ ; :|
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | ( [ {| A | R | S | T | D | H | N | E | I | O | ) ] }|
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | - , <| Z | X | C | V | B | K | M | ? | | | ^ | _ . >|
* |------+------+------+------+------+------+------+------+------+------+------+------|
* |Lower |Raise | Ctrl | Alt | Bksp | Spc |Enter |LShft | ESC | < | v | > |
* `-----------------------------------------------------------------------------------'
*/
[_COLE] = KEYMAP(
TD(TD_BTK), KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_EQL, TD(TD_TDE),
TD(TD_LPRN), KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, TD(TD_RPRN),
TD(TD_MIN), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_SLSH, KC_BSLS, KC_UP, TD(TD_USC),
LOWER, RAISE, OSM(MOD_LCTL), OSM(MOD_LALT), KC_SPC, KC_BSPC, KC_ENT, OSM(MOD_LSFT), KC_ESC, KC_LEFT, KC_DOWN, KC_RGHT),
/* Lower
* ,-----------------------------------------------------------------------------------.
* | ---- | ---- | ---- | ---- | ---- | ---- | 7 | 8 | 9 | * | / | ^ |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | ---- | ---- | ---- | ---- | ---- | ---- | 4 | 5 | 6 | + | - | ---- |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | ---- | ---- | ---- | ---- | ---- | ---- | 1 | 2 | 3 | = | ---- | ---- |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | ---- | ---- | ---- | ---- | ---- | ---- | ---- | 0 | . | ---- | ---- | ---- |
* `-----------------------------------------------------------------------------------'
*/
[_LOWER] = KEYMAP(
____, ____, ____, ____, ____, ____, KC_7, KC_8, KC_9, KC_PAST, KC_PSLS, KC_CIRC,
____, ____, ____, ____, ____, ____, KC_4, KC_5, KC_6, KC_PPLS, KC_PMNS, ____,
____, ____, ____, ____, ____, ____, KC_1, KC_2, KC_3, KC_PEQL, ____, ____,
____, ____, ____, ____, ____, ____, ____, KC_0, KC_MNXT, ____, ____, ____),
/* Raise
* ,-----------------------------------------------------------------------------------.
* | F1 | F2 | F3 | F4 | F5 | F6 | ! | @ | # | $ | % | ` ~ |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | F7 | F8 | F9 | F10 | F11 | F12 | ^ | & | * | ( | ) | - _ |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | ____ | ____ | ____ | ____ | ____ | ____ | [ { | ] } | \ | | ; : | ' " | = + |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | , < | . > | / ? |
* `-----------------------------------------------------------------------------------'
*/
[_RAISE] = KEYMAP(
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_GRV,
KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_MINS,
KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_LBRC, KC_RBRC, KC_BSLS, KC_SCLN, KC_QUOT, KC_EQL,
____, ____, ____, ____, ____, ____, ____, ____, ____, KC_COMM, KC_DOT, KC_SLSH),
/* Adjust (Lower + Raise)
* ,-----------------------------------------------------------------------------------.
* | Reset| ____ | ____ | ____ | ____ | ____ | ____ | LOCK | ____ | ____ | ____ | VUP |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | ____ | ____ | RUN | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | VDWN |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | PGUP | MUTE |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | HOME | PGDN | END |
* `-----------------------------------------------------------------------------------'
*/
[_AUX] = KEYMAP(
RESET, ____, ____, ____, ____, ____, ____, LGUI(KC_L), ____, ____, ____, KC_VOLU,
____, ____, LGUI(KC_R), ____, ____, ____, ____, ____, ____, ____, ____, KC_VOLD,
____, ____, ____, ____, ____, ____, ____, ____, ____, ____, KC_PGUP, KC_MUTE,
____, ____, ____, ____, KC_TAB, KC_DEL, ____, ____, ____, KC_HOME, KC_PGDOWN, KC_END)
};
qk_tap_dance_action_t tap_dance_actions[] = {
[TD_BTK] = ACTION_TAP_DANCE_DOUBLE(KC_QUOT, KC_GRV),
[TD_TDE] = ACTION_TAP_DANCE_DOUBLE(KC_SCLN, KC_TILD),
[TD_LPRN] = ACTION_TAP_DANCE_DOUBLE(KC_LBRC, KC_LPRN),
[TD_RPRN] = ACTION_TAP_DANCE_DOUBLE(KC_RBRC, KC_RPRN),
[TD_MIN] = ACTION_TAP_DANCE_DOUBLE(KC_COMM, KC_MINS),
[TD_USC] = ACTION_TAP_DANCE_DOUBLE(KC_DOT, KC_UNDS)};
void persistent_default_layer_set(uint16_t default_layer)
{
eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer);
};
void matrix_scan_user(void){};
void matrix_init_user(void){};
bool process_record_user(uint16_t keycode, keyrecord_t *record)
{
switch (keycode)
{
case COLE:
if (record->event.pressed)
{
persistent_default_layer_set(1UL << _COLE);
}
return false;
break;
case LOWER:
if (record->event.pressed)
{
layer_on(_LOWER);
update_tri_layer(_LOWER, _RAISE, _AUX);
}
else
{
layer_off(_LOWER);
update_tri_layer(_LOWER, _RAISE, _AUX);
}
return false;
break;
case RAISE:
if (record->event.pressed)
{
layer_on(_RAISE);
update_tri_layer(_LOWER, _RAISE, _AUX);
}
else
{
layer_off(_RAISE);
update_tri_layer(_LOWER, _RAISE, _AUX);
}
return false;
break;
case AUX:
if (record->event.pressed)
{
layer_on(_AUX);
}
else
{
layer_off(_AUX);
}
return false;
break;
}
return true;
}

View file

@ -0,0 +1,26 @@
# Build Options
# change to "no" to disable the options, or define them in the Makefile in
# the appropriate keymap folder that will get included automatically
#
BOOTMAGIC_ENABLE = no # Virtual DIP switch configuration(+1000)
MOUSEKEY_ENABLE = no # Mouse keys(+4700)
EXTRAKEY_ENABLE = yes # Audio control and System control(+450)
CONSOLE_ENABLE = no # Console for debug(+400)
COMMAND_ENABLE = no # Commands for debug and configuration
TAP_DANCE_ENABLE = yes
NKRO_ENABLE = yes # Nkey Rollover - if this doesn't work, see here: https://github.com/tmk/tmk_keyboard/wiki/FAQ#nkro-doesnt-work
BACKLIGHT_ENABLE = no # Enable keyboard backlight functionality
MIDI_ENABLE = no # MIDI controls
AUDIO_ENABLE = no # Audio output on port C6
UNICODE_ENABLE = no # Unicode
BLUETOOTH_ENABLE = no # Enable Bluetooth with the Adafruit EZ-Key HID
RGBLIGHT_ENABLE = no # Enable WS2812 RGB underlight. Do not enable this with audio at the same time.
ONEHAND_ENABLE = no # Enable one-hand typing
# Do not enable SLEEP_LED_ENABLE. it uses the same timer as BACKLIGHT_ENABLE
SLEEP_LED_ENABLE = no # Breathing sleep LED during USB suspend
ifndef QUANTUM_DIR
include ../../../../Makefile
endif