summaryrefslogtreecommitdiffstats
path: root/keyboards
diff options
context:
space:
mode:
authorJakob Weickmann <57487288+jweickm@users.noreply.github.com>2021-09-19 20:53:47 +0200
committerGitHub <noreply@github.com>2021-09-19 11:53:47 -0700
commita068b14686507f67c7f0956d3367510bd9041641 (patch)
tree109ce42ed7043893c8c477edc3eaedaee5d87af2 /keyboards
parentddb6821b97c6d276e4190f98f49a4ee164fd0477 (diff)
[Keymap] Added my own keymap for MIT Planck (#14481)
Co-authored-by: Drashna Jaelre <drashna@live.com> Co-authored-by: Ryan <fauxpark@gmail.com>
Diffstat (limited to 'keyboards')
-rw-r--r--keyboards/planck/keymaps/jweickm/config.h69
-rw-r--r--keyboards/planck/keymaps/jweickm/keymap.c1131
-rw-r--r--keyboards/planck/keymaps/jweickm/readme.md154
-rw-r--r--keyboards/planck/keymaps/jweickm/rules.mk5
4 files changed, 1359 insertions, 0 deletions
diff --git a/keyboards/planck/keymaps/jweickm/config.h b/keyboards/planck/keymaps/jweickm/config.h
new file mode 100644
index 0000000000..3b34ddf832
--- /dev/null
+++ b/keyboards/planck/keymaps/jweickm/config.h
@@ -0,0 +1,69 @@
+/*
+ * Copyright 2018 Jack Humbert <jack.humb@gmail.com>
+ *
+ * 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/>.
+ */
+#pragma once
+
+#ifdef AUDIO_ENABLE
+ #define STARTUP_SONG SONG(PLANCK_SOUND)
+ // #define STARTUP_SONG SONG(NO_SOUND)
+
+ #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \
+ SONG(COLEMAK_SOUND), \
+ SONG(DVORAK_SOUND), \
+ SONG(WORKMAN_SOUND), \
+ SONG(PLOVER_SOUND), \
+ SONG(STARTUP_SOUND), \
+ SONG(PREONIC_SOUND), \
+ SONG(GOODBYE_SOUND), \
+ }
+#endif
+
+/*
+ * MIDI options
+ */
+
+/* enable basic MIDI features:
+ - MIDI notes can be sent when in Music mode is on
+*/
+
+#define MIDI_BASIC
+
+/* enable advanced MIDI features:
+ - MIDI notes can be added to the keymap
+ - Octave shift and transpose
+ - Virtual sustain, portamento, and modulation wheel
+ - etc.
+*/
+//#define MIDI_ADVANCED
+
+
+// Most tactile encoders have detents every 4 stages
+#define ENCODER_RESOLUTION 4
+
+// settings for HOME ROW MODS
+#define TAPPING_TERM 160 // 200 ms is the default value
+#define TAPPING_TERM_PER_KEY
+//#define PERMISSIVE_HOLD
+#define IGNORE_MOD_TAP_INTERRUPT
+#define TAPPING_FORCE_HOLD_PER_KEY
+
+// settings for LEADER key
+#define LEADER_PER_KEY_TIMING
+#define LEADER_TIMEOUT 250
+#define LEADER_NO_TIMEOUT
+
+#define RGBLIGHT_SLEEP // RGB lighting will switch off when the host goes to sleep
+#define RGBLIGHT_LAYERS
diff --git a/keyboards/planck/keymaps/jweickm/keymap.c b/keyboards/planck/keymaps/jweickm/keymap.c
new file mode 100644
index 0000000000..02138a876c
--- /dev/null
+++ b/keyboards/planck/keymaps/jweickm/keymap.c
@@ -0,0 +1,1131 @@
+/* Copyright 2015-2017 Jack Humbert
+ * Copyright 2021 Jakob Weickmann
+ *
+ 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/>.
+ */
+#include QMK_KEYBOARD_H
+#include "muse.h"
+
+enum planck_layers {
+ _HRWIDECOLEMAK,
+ _HRWIDECOLEMAK_DE,
+ _GAMING,
+ _WIDECOLEMAK,
+ _LOWER,
+ _RAISE,
+ _LOWER_DE,
+ _RAISE_DE,
+ _ADJUST,
+ _NAV,
+ _VIM,
+ _NUM,
+ _MOUSE,
+};
+
+enum planck_keycodes { HRWIDECOLEMAK = SAFE_RANGE, GAMING, WIDECOLEMAK, TG_COLEMAK, VIM_O, VIM_V, KC_SVD_BD, KC_SVU_BU, KC_TAB_MPLY, ALT_TAB, CTL_TAB, DE_ae, DE_oe, DE_ue, DE_AE, DE_OE, DE_SZ, DE_EGRAVE, DE_EAIGU, KC_CURRENCY, KC_DE_SWITCH, LANG_SWITCH, DE_SLSH_QUST, DE_QUOT, DE_SCLN, DE_BSLS, M_ESCM, M_RGUI_SCLN, DE_DOT_RAB, DE_COMM_LAB };
+
+// Tap Dance declarations
+enum tap_dance_codes {
+ TD_PRN, // round brackets (parentheses)
+ TD_PRN_DE, // round brackets (parentheses)
+ TD_BRC, // square brackets
+ TD_BRC_DE, // square brackets
+ TD_CBR, // curly brackets
+ TD_CBR_DE, // curly brackets
+ TD_VIM_GG // single tap to scroll down, double tap to scroll up
+};
+
+#define LOWER MO(_LOWER)
+#define RAISE MO(_RAISE)
+
+const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
+
+ /* _HRWIDECOLEMAK
+ * ,-----------------------------------------------------------------------------------.
+ * | G-Q | A-W | S-F | C-P |_Num-B|Vol/B+|_Num-J| C-L | S-U | A-Y | G-/ | ü |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | A | R | S | T | G | TAB | M | N | E | I | O | ' |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * |_Mo-Z | X | C | D | V |Vol/B-| K | H | , | . |_Mo-/ | \ |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * |C-CAPS| LEAD | BSPC |_L-ESC| LSFT | _Nav-SPC |_R-ENT|S-DEL | RALT |_Mo <-|_Mo ->|
+ * `-----------------------------------------------------------------------------------'
+ */
+ [_HRWIDECOLEMAK] = LAYOUT_planck_grid(
+ LGUI_T(KC_Q), LALT_T(KC_W), LSFT_T(KC_F), LCTL_T(KC_P), LT(_NUM, KC_B), KC_SVU_BU, LT(_NUM, KC_J), RCTL_T(KC_L), RSFT_T(KC_U), LALT_T(KC_Y), RGUI_T(KC_SCLN), DE_ue,
+ KC_A, KC_R, KC_S, KC_T, KC_G, KC_TAB, KC_M, KC_N, KC_E, KC_I, KC_O, KC_QUOT,
+ LT(_MOUSE, KC_Z), KC_X, KC_C, KC_D, KC_V, KC_SVD_BD, KC_K, KC_H, KC_COMM, KC_DOT, LT(_MOUSE, KC_SLSH), KC_BSLS,
+ LCTL_T(KC_CAPS), KC_LEAD, KC_BSPC, LT(_LOWER, KC_ESC), OSM(MOD_LSFT), LT(_NAV, KC_SPC), LT(_NAV, KC_SPC), LT(_RAISE, KC_ENT), RSFT_T(KC_DEL), KC_RALT, LT(_MOUSE, KC_LEFT), LT(_MOUSE, KC_RIGHT)
+ ),
+
+ /* _HRWIDECOLEMAK_DE
+ * same as above, when the PC is set to German layout
+ * ,-----------------------------------------------------------------------------------.
+ * | G-Q | A-W | S-F | C-P |_Num-B|Vol/B+|_Num-J| C-L | S-U | A-Y | G-/ | ü |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | A | R | S | T | G | TAB | M | N | E | I | O | ' |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * |_Mo-Z | X | C | D | V |Vol/B-| K | H | , | . |_Mo-/ | \ |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * |C-CAPS| LEAD | BSPC |_L-ESC| LSFT | _Nav-SPC |_R-ENT|S-DEL | RALT |_Mo <-|_Mo ->|
+ * `-----------------------------------------------------------------------------------'
+ */
+ [_HRWIDECOLEMAK_DE] = LAYOUT_planck_grid(
+ LGUI_T(KC_Q), LALT_T(KC_W), LSFT_T(KC_F), LCTL_T(KC_P), LT(_NUM, KC_B), KC_SVU_BU, LT(_NUM, KC_J), RCTL_T(KC_L), RSFT_T(KC_U), LALT_T(KC_Z), M_RGUI_SCLN, KC_LBRC,
+ KC_A, KC_R, KC_S, KC_T, KC_G, KC_TAB, KC_M, KC_N, KC_E, KC_I, KC_O, DE_QUOT,
+ LT(_MOUSE, KC_Y), KC_X, KC_C, KC_D, KC_V, KC_SVD_BD, KC_K, KC_H, DE_COMM_LAB, DE_DOT_RAB, DE_SLSH_QUST, DE_BSLS,
+ LCTL_T(KC_CAPS), KC_LEAD, KC_BSPC, LT(_LOWER_DE, KC_ESC), OSM(MOD_LSFT), LT(_NAV, KC_SPC), LT(_NAV, KC_SPC), LT(_RAISE_DE, KC_ENT), RSFT_T(KC_DEL), KC_RALT, LT(_MOUSE, KC_LEFT), LT(_MOUSE, KC_RIGHT)
+ ),
+
+ /* _GAMING
+ * ,-----------------------------------------------------------------------------------.
+ * | ESC | 1 | 2 | 3 | 4 | 5 | 6 | 7 | F5 | F8 | F9 |Vol/B+|
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | TAB | Q | W | E | R | T | Y | U | I | O | P |Vol/B-|
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | LSFT | A | S | D | F | G | H | J | Z | M | ; |_CM-EN|
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | LCTL | C | B | X | LALT | SPACE | ENT | RALT | ____ | ____ | !GAME|
+ * `-----------------------------------------------------------------------------------'
+ */
+ [_GAMING] = LAYOUT_planck_grid(
+ KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_F5, KC_F8, KC_F9, KC_VOLU,
+ KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_VOLD,
+ KC_LSFT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_Z, KC_M, KC_SCLN, TG_COLEMAK,
+ KC_LCTL, KC_C, KC_B, KC_X, KC_LALT, KC_SPC, KC_SPC, KC_ENT, KC_RALT, KC_TRNS, KC_TRNS, GAMING
+ ),
+
+ /* WIDECOLEMAK
+ * no mod taps
+ * ,-----------------------------------------------------------------------------------.
+ * | Q | W | F | P | B |Vol/B+| J | L | U | Y | / | Ü |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | A | R | S | T | G | TAB | M | N | E | I | O | ' |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | Z | X | C | D | V |Vol/B-| K | H | , | . | / |!CM-EN|
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * |C-CAPS|G-TAB |MN-ESC|_L-BSP| LSFT | _NAV-SPC |_R-ENT|S-DEL |C-TAB |_Mo <-|_Mo ->|
+ * `-----------------------------------------------------------------------------------'
+ */
+ [_WIDECOLEMAK] = LAYOUT_planck_grid(
+ KC_Q, KC_W, KC_F, KC_P, KC_B, KC_SVU_BU, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, DE_ue,
+ KC_A, KC_R, KC_S, KC_T, KC_G, KC_TAB_MPLY, KC_M, KC_N, KC_E, KC_I, KC_O, KC_QUOT,
+ KC_Z, KC_X, KC_C, KC_D, KC_V, KC_SVD_BD, KC_K, KC_H, KC_COMM, KC_DOT, KC_SLSH, TG_COLEMAK,
+ LCTL_T(KC_CAPS), LGUI_T(KC_TAB), M_ESCM, LT(_LOWER_DE, KC_BSPC), OSM(MOD_LSFT), LT(_NAV, KC_SPC), LT(_NAV, KC_SPC), LT(_RAISE, KC_ENT), RSFT_T(KC_DEL), KC_LALT, LT(_MOUSE, KC_LEFT), LT(_MOUSE, KC_RIGHT)
+ ),
+
+ /* _LOWER
+ * ,-----------------------------------------------------------------------------------.
+ * | ! | @ | # | $ | % | ~ | ^ | & | * | ( | ) | Ö |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | F1 | F2 | F3 | F4 | F5 | F6 | ß | _ | + | { | } | Ä |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | F7 | F8 | F9 | F10 | F11 | F12 | MPLY | / | \ | | | € | è |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * |!MOUSE| ____ | ____ | ____ | ____ | ____ | ____ | Vol- | Vol+ | ↓ | ↑ |
+ * `-----------------------------------------------------------------------------------'
+ */
+ [_LOWER] = LAYOUT_planck_grid(
+ KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_TILD, KC_CIRC, KC_AMPR, KC_ASTR, TD(TD_PRN), KC_RPRN, DE_OE,
+ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, DE_SZ, KC_UNDS, KC_PLUS, TD(TD_CBR), KC_RCBR, DE_AE,
+ KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MPLY, KC_SLSH, KC_NUBS, LSFT(KC_NUBS), KC_CURRENCY, DE_EGRAVE,
+ TG(_MOUSE), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_DOWN, KC_UP
+ ),
+
+ /* _LOWER_DE
+ * ,-----------------------------------------------------------------------------------.
+ * | ! | @ | # | $ | % | ~ | ^ | & | * | ( | ) | Ö |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | F1 | F2 | F3 | F4 | F5 | F6 | ß | _ | + | { | } | Ä |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | F7 | F8 | F9 | F10 | F11 | F12 | MPLY | / | \ | | | € | ` |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * |!MOUSE| ____ | ____ | ____ | ____ | ____ | ____ | Vol- | Vol+ | ↓ | ↑ |
+ * `-----------------------------------------------------------------------------------'
+ */
+ [_LOWER_DE] = LAYOUT_planck_grid(
+ KC_EXLM, RALT(KC_Q), KC_BSLS, KC_DLR, KC_PERC, RALT(KC_RBRC), KC_GRV, KC_CIRC, KC_RCBR, TD(TD_PRN_DE), KC_LPRN, LSFT(KC_SCLN),
+ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, LSFT(KC_SLSH), KC_RBRC, TD(TD_CBR_DE), RALT(KC_0), LSFT(KC_QUOT),
+ KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MPLY, LSFT(KC_7), RALT(KC_MINS), RALT(KC_NUBS), KC_CURRENCY, KC_PLUS,
+ TG(_MOUSE), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_VOLD, KC_VOLU, KC_DOWN, KC_UP
+ ),
+
+ /* _RAISE
+ * ,-----------------------------------------------------------------------------------.
+ * | 1 | 2 | 3 | 4 | 5 | ` | 6 | 7 | 8 | 9 | 0 | ö |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | F1 | F2 | F3 | F4 | F5 | F6 | ß | - | = | [ | ] | ä |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | F7 | F8 | F9 | F10 | F11 | F12 | MPLY | \ | , | . | / | é |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * |!MOUSE| ____ | ____ | BSPC | ____ | ____ | ____ | |<< | >>| | ↓ | ↑ |
+ * `-----------------------------------------------------------------------------------'
+ */
+ [_RAISE] = LAYOUT_planck_grid(
+ KC_1, KC_2, KC_3, KC_4, KC_5, KC_GRV, KC_6, KC_7, KC_8, KC_9, KC_0, DE_oe,
+ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, DE_SZ, KC_MINS, KC_EQL, TD(TD_BRC), KC_RBRC, DE_ae,
+ KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MPLY, KC_BSLS, KC_COMM, KC_DOT, KC_SLSH, DE_EAIGU,
+ TG(_MOUSE), KC_TRNS, KC_BSPC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_DOWN, KC_UP
+ ),
+
+ /* _RAISE_DE
+ * ,-----------------------------------------------------------------------------------.
+ * | 1 | 2 | 3 | 4 | 5 | ` | 6 | 7 | 8 | 9 | 0 | ö |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | F1 | F2 | F3 | F4 | F5 | F6 | ß | - | = | [ | ] | ä |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | F7 | F8 | F9 | F10 | F11 | F12 | MPLY | \ | , | . | / | ´ |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * |!MOUSE| ____ | ____ | BSPC | ____ | ____ | ____ | |<< | >>| | ↓ | ↑ |
+ * `-----------------------------------------------------------------------------------'
+ */
+ [_RAISE_DE] = LAYOUT_planck_grid(
+ KC_1, KC_2, KC_3, KC_4, KC_5, LSFT(KC_GRV), KC_6, KC_7, KC_8, KC_9, KC_0, KC_SCLN,
+ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_SLSH, LSFT(KC_0), TD(TD_BRC_DE), RALT(KC_9), KC_QUOT,
+ KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MPLY, RALT(KC_MINS), KC_COMM, KC_DOT, DE_SLSH_QUST, KC_EQL,
+ TG(_MOUSE), KC_TRNS, KC_BSPC, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPRV, KC_MNXT, KC_DOWN, KC_UP
+ ),
+
+ /* _ADJUST
+ * ,-----------------------------------------------------------------------------------.
+ * | A-SFT| RESET| DEBUG|RGBTOG|RGBMOD|RGBHUI|RGBHUD|RGBSAI|RGBSAD|RGBVAI|RGBVAD| DE_SW|
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | A-GRV|EEPRST|MU_MOD| AU_ON|AU_OFF|AGNORM|AGSWAP|!HRWCM| !WCM | A-GRV| !LANG| !GAME|
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | ____ |MUV_DE|MUV_IN| MU_ON|MU_OFF| MI_ON|MI_OFF| Vol- | MPLY | Vol+ | ____ | ____ |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ | ____ |EEPRST|
+ * `-----------------------------------------------------------------------------------'
+ */
+ [_ADJUST] = LAYOUT_planck_grid(
+ LALT(KC_LSFT), RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DE_SWITCH,
+ LALT(KC_GRV), EEP_RST, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, HRWIDECOLEMAK, WIDECOLEMAK, LALT(KC_GRV), LANG_SWITCH, GAMING,
+ KC_TRNS, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, KC_SVD_BD, KC_MPLY, KC_SVU_BU, 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, EEPROM_RESET
+ ),
+
+ /* _NAV
+ * ,-----------------------------------------------------------------------------------.
+ * |A(TAB)| C(->)| !LANG|A(GRV)| C(<-)| >>| | HOME | -> | PGUP | COPY | PASTE| DE_SW|
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * |C(TAB)| TAB | ESC | ENT |VIM_GG| MPLY | <- | ↓ | ↑ | -> | END | VIM_O|
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | LSFT | XXXX |S(DEL)| CAPS | VIM_V| MUTE | HOME | PGDN | LSFT | RFST | C(F) | C(F) |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | XXXX | XXXX | ____ | BSPC | ____ | ____ | ENT | DEL | ____ | ____ | DE_SW|
+ * `-----------------------------------------------------------------------------------'
+ */
+ [_NAV] = LAYOUT_planck_grid(
+ ALT_TAB, LCTL(KC_RGHT), LANG_SWITCH, LALT(KC_GRV), LCTL(KC_LEFT), KC_MNXT, KC_HOME, KC_RIGHT, KC_PGUP, LCTL(KC_INS), LSFT(KC_INS), KC_DE_SWITCH,
+ CTL_TAB, KC_TAB, KC_ESC, KC_ENT, TD(TD_VIM_GG), KC_MPLY, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_END, VIM_O,
+ KC_LSFT, KC_NO, LSFT(KC_DEL), KC_CAPS, VIM_V, KC_MUTE, KC_HOME, KC_PGDN, KC_LSFT, KC_RSFT, LCTL(KC_F), LCTL(KC_F),
+ KC_NO, KC_NO, KC_TRNS, KC_BSPC, KC_TRNS, LT(_NAV, KC_SPC), LT(_NAV, KC_SPC), KC_ENT, KC_DEL, KC_TRNS, KC_TRNS, KC_DE_SWITCH
+ ),
+
+ /* _VIM
+ * ,-----------------------------------------------------------------------------------.
+ * |A(TAB)| C(->)| !LANG|A(GRV)| C(<-)| >>| | HOME | -> | PGUP | COPY | PASTE| DE_SW|
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * |C(TAB)| TAB | ESC | ENT |VIM_GG| MPLY | <- | ↓ | ↑ | -> | END | VIM_O|
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | LSFT | XXXX |S(DEL)| CAPS | VIM_V| MUTE | HOME | PGDN | LSFT | RFST | C(F) | C(F) |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | XXXX | XXXX | !VIM | BSPC | ____ | ____ | ENT | DEL | ____ | ↓ | ↑ |
+ * `-----------------------------------------------------------------------------------'
+ */
+ [_VIM] = LAYOUT_planck_grid(
+ ALT_TAB, LCTL(KC_RGHT), LANG_SWITCH, LALT(KC_GRV), LCTL(KC_LEFT), KC_MNXT, KC_HOME, KC_RIGHT, KC_PGUP, LCTL(KC_INS), LSFT(KC_INS), KC_DE_SWITCH,
+ CTL_TAB, KC_TAB, KC_ESC, KC_ENT, TD(TD_VIM_GG), KC_MPLY, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, KC_END, VIM_O,
+ KC_LSFT, KC_NO, LSFT(KC_DEL), KC_CAPS, VIM_V, KC_MUTE, KC_HOME, KC_PGDN, KC_LSFT, KC_RSFT, LCTL(KC_F), LCTL(KC_F),
+ KC_NO, KC_NO, TG(_VIM), KC_BSPC, KC_TRNS, LT(_NAV, KC_SPC), LT(_NAV, KC_SPC), KC_ENT, KC_DEL, KC_TRNS, KC_DOWN, KC_UP
+ ),
+
+ /* _NUM
+ * ,-----------------------------------------------------------------------------------.
+ * | F1 | F2 | F3 | F4 | |<< |NUMLCK| >>| | 7 | 8 | 9 | - | ____ |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | F5 | F6 | F7 | F8 | Vol+ | MPLY | * | 4 | 5 | 6 | + | . |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | F9 | F10 | F11 | F12 | Vol- | MUTE | = | 1 | 2 | 3 | / | , |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | ____ | ____ | ____ | ____ | ____ | ____ | 0 | . | , | = | ____ |
+ * `-----------------------------------------------------------------------------------'
+ */
+ [_NUM] = LAYOUT_planck_grid(
+ KC_F1, KC_F2, KC_F3, KC_F4, KC_MPRV, KC_NLCK, KC_MNXT, KC_P7, KC_P8, KC_P9, KC_MINS, KC_TRNS,
+ KC_F5, KC_F6, KC_F7, KC_F8, KC_VOLU, KC_MPLY, KC_ASTR, KC_P4, KC_P5, KC_P6, KC_PLUS, KC_DOT,
+ KC_F9, KC_F10, KC_F11, KC_F12, KC_VOLD, KC_MUTE, KC_EQL, KC_P1, KC_P2, KC_P3, KC_SLSH, KC_COMM,
+ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_P0, KC_DOT, KC_COMM, KC_EQL, KC_TRNS
+ ),
+
+ /* _MOUSE
+ * ,-----------------------------------------------------------------------------------.
+ * | XXXX | XXXX | MBTN4| MBTN5| XXXX | Bri+ | XXXX | MWHL↑|MAUS↑ | MWHL↑| XXXX | XXXX |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | XXXX | MBTN3| MBTN2| MBTN1| XXXX | MPLY | XXXX |MAUS<-|MAUS↓ |MAUS->| XXXX | XXXX |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * | F9 | XXXX | XXXX | XXXX | XXXX | Bri- | XXXX | MWHL↓| XXXX | XXXX | ____ | XXXX |
+ * |------+------+------+------+------+------+------+------+------+------+------+------|
+ * |!MOUSE| XXXX | XXXX | ____ | XXXX | MAUS_ACCEL2 | ____ | XXXX | XXXX | ↓ | ↑ |
+ * `-----------------------------------------------------------------------------------'
+ */
+ [_MOUSE] = LAYOUT_planck_grid(
+ KC_NO, KC_NO, KC_BTN4, KC_BTN5, KC_NO, KC_BRIU, KC_NO, KC_WH_U, KC_MS_U, KC_WH_U, KC_NO, KC_NO,
+ KC_NO, KC_BTN3, KC_BTN2, KC_BTN1, KC_NO, KC_MPLY, KC_NO, KC_MS_L, KC_MS_D, KC_MS_R, KC_NO, KC_NO,
+ KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_BRID, KC_NO, KC_WH_D, KC_NO, KC_NO, KC_TRNS, KC_NO,
+ TG(_MOUSE), KC_NO, KC_NO, KC_TRNS, KC_NO, KC_ACL2, KC_ACL2, KC_TRNS, KC_NO, KC_NO, KC_DOWN, KC_UP
+ )
+
+};
+
+// define the tap dance functions
+void dance_prn(qk_tap_dance_state_t *state, void *user_data) {
+ if (state->count == 1) {
+ tap_code16(KC_LPRN);
+ } else {
+ tap_code16(KC_LPRN);
+ tap_code16(KC_RPRN);
+ tap_code(KC_LEFT);
+ }
+}
+void dance_brc(qk_tap_dance_state_t *state, void *user_data) {
+ if (state->count == 1) {
+ tap_code(KC_LBRC);
+ } else {
+ tap_code(KC_LBRC);
+ tap_code(KC_RBRC);
+ tap_code(KC_LEFT);
+ }
+}
+void dance_cbr(qk_tap_dance_state_t *state, void *user_data) {
+ if (state->count == 1) {
+ tap_code16(KC_LCBR);
+ } else {
+ tap_code16(KC_LCBR);
+ tap_code16(KC_RCBR);
+ tap_code(KC_LEFT);
+ }
+}
+void dance_prn_de(qk_tap_dance_state_t *state, void *user_data) {
+ if (state->count == 1) {
+ tap_code16(KC_ASTR);
+ } else {
+ tap_code16(KC_ASTR);
+ tap_code16(KC_LPRN);
+ tap_code(KC_LEFT);
+ }
+}
+void dance_brc_de(qk_tap_dance_state_t *state, void *user_data) {
+ if (state->count == 1) {
+ tap_code16(RALT(KC_8));
+ } else {
+ tap_code16(RALT(KC_8));
+ tap_code16(RALT(KC_9));
+ tap_code(KC_LEFT);
+ }
+}
+void dance_cbr_de(qk_tap_dance_state_t *state, void *user_data) {
+ if (state->count == 1) {
+ tap_code16(RALT(KC_7));
+ } else {
+ tap_code16(RALT(KC_7));
+ tap_code16(RALT(KC_0));
+ tap_code(KC_LEFT);
+ }
+}
+void vim_gg(qk_tap_dance_state_t *state, void *user_data) {
+ if (state->count == 1) {
+ tap_code16(LCTL(KC_END));
+ } else {
+ tap_code16(LCTL(KC_HOME));
+ }
+}
+
+qk_tap_dance_action_t tap_dance_actions[] = {
+ // declare tap dance actions here
+ [TD_PRN] = ACTION_TAP_DANCE_FN(dance_prn), [TD_BRC] = ACTION_TAP_DANCE_FN(dance_brc), [TD_CBR] = ACTION_TAP_DANCE_FN(dance_cbr), [TD_PRN_DE] = ACTION_TAP_DANCE_FN(dance_prn_de), [TD_BRC_DE] = ACTION_TAP_DANCE_FN(dance_brc_de), [TD_CBR_DE] = ACTION_TAP_DANCE_FN(dance_cbr_de), [TD_VIM_GG] = ACTION_TAP_DANCE_FN(vim_gg)};
+
+float thumb_factor = 0.95;
+float index_factor = 1.1;
+float middle_factor = 1.2;
+float ring_factor = 1.25;
+float pinky_factor = 1.15;
+float td_factor = 1.4;
+
+// define the per_key_tapping_term
+uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) {
+ switch (keycode) {
+ // thumb keys
+ case RSFT_T(KC_DEL):
+ return TAPPING_TERM * thumb_factor;
+ case RCTL_T(KC_TAB):
+ return TAPPING_TERM * thumb_factor;
+ case LT(_NAV, KC_LEFT):
+ return TAPPING_TERM * thumb_factor;
+ case LT(_NAV, KC_RIGHT):
+ return TAPPING_TERM * thumb_factor;
+ case LT(_LOWER, KC_BSPC):
+ return TAPPING_TERM * thumb_factor;
+ case LT(_LOWER_DE, KC_BSPC):
+ return TAPPING_TERM * thumb_factor;
+ case LT(_RAISE, KC_ENT):
+ return TAPPING_TERM * thumb_factor;
+ case LT(_RAISE_DE, KC_ENT):
+ return TAPPING_TERM * thumb_factor;
+ case LT(_NAV, KC_SPC):
+ return TAPPING_TERM * 1.0;
+ case LALT_T(KC_ESC):
+ return TAPPING_TERM * thumb_factor;
+
+ // index finger keys
+ case LCTL_T(KC_P):
+ return TAPPING_TERM * index_factor;
+ case RCTL_T(KC_L):
+ return TAPPING_TERM * (index_factor + 0.1);
+ case LT(_NUM, KC_B):
+ return TAPPING_TERM * (index_factor + 0.1);
+ case LT(_NUM, KC_J):
+ return TAPPING_TERM * index_factor;
+
+ // middle finger keys
+ case LSFT_T(KC_F):
+ return TAPPING_TERM * middle_factor;
+ case RSFT_T(KC_U):
+ return TAPPING_TERM * middle_factor;
+
+ // ring finger keys
+ case LALT_T(KC_W):
+ return TAPPING_TERM * ring_factor;
+ case LALT_T(KC_Y):
+ return TAPPING_TERM * ring_factor;
+ case LGUI_T(KC_TAB):
+ return TAPPING_TERM * ring_factor;
+
+ // pinky keys
+ case LGUI_T(KC_Q):
+ return TAPPING_TERM * pinky_factor;
+ case RGUI_T(KC_SCLN):
+ return TAPPING_TERM * pinky_factor;
+ case RGUI_T(KC_LBRC):
+ return TAPPING_TERM * pinky_factor;
+ case LT(_MOUSE, KC_Z):
+ return TAPPING_TERM * pinky_factor;
+ case LT(_MOUSE, KC_SLSH):
+ return TAPPING_TERM * pinky_factor;
+ case LCTL_T(KC_CAPS):
+ return TAPPING_TERM * pinky_factor;
+
+ // tap-dance actions
+ case TD(TD_PRN):
+ return TAPPING_TERM * td_factor;
+ case TD(TD_BRC):
+ return TAPPING_TERM * td_factor;
+ case TD(TD_CBR):
+ return TAPPING_TERM * td_factor;
+ case TD(TD_PRN_DE):
+ return TAPPING_TERM * td_factor;
+ case TD(TD_BRC_DE):
+ return TAPPING_TERM * td_factor;
+ case TD(TD_CBR_DE):
+ return TAPPING_TERM * td_factor;
+ case TD(TD_VIM_GG):
+ return TAPPING_TERM * td_factor;
+
+ default:
+ return TAPPING_TERM;
+ }
+}
+
+// alt tab function setup
+bool is_alt_tab_active = false;
+bool is_ctl_tab_active = false;
+bool de_layout_active = false;
+
+static uint16_t key_timer;
+
+bool process_record_user(uint16_t keycode, keyrecord_t *record) {
+ switch (keycode) {
+ case WIDECOLEMAK:
+ if (record->event.pressed) {
+ set_single_persistent_default_layer(_WIDECOLEMAK);
+ }
+ return false;
+ break;
+ case HRWIDECOLEMAK:
+ if (record->event.pressed) {
+ set_single_persistent_default_layer(_HRWIDECOLEMAK);
+ }
+ return false;
+ break;
+ case GAMING:
+ if (record->event.pressed) {
+ layer_invert(_GAMING);
+ }
+ return false;
+ break;
+ case TG_COLEMAK:
+ if (record->event.pressed) {
+ tap_code(KC_ENT);
+ layer_invert(_WIDECOLEMAK);
+ }
+ return false;
+ break;
+ case VIM_O:
+ if (record->event.pressed) {
+ tap_code(KC_END);
+ tap_code(KC_ENT);
+ }
+ return false;
+ break;
+ case VIM_V:
+ if (record->event.pressed) {
+ if (get_mods() & MOD_MASK_SHIFT) {
+ clear_mods();
+ } else {
+ register_mods(MOD_LSFT);
+ }
+ }
+ return false;
+ break;
+ case KC_SVU_BU: // increase backlight when pressing shift and vol up
+ if (record->event.pressed) {
+ if (get_mods() & MOD_MASK_SHIFT) {
+ register_code(KC_BRIU);
+ } else if (get_mods() & MOD_MASK_CTRL) {
+ register_code(KC_MNXT);
+ } else {
+ register_code(KC_VOLU);
+ }
+ } else {
+ unregister_code(KC_BRIU);
+ unregister_code(KC_MNXT);
+ unregister_code(KC_VOLU);
+ }
+ return false;
+ case KC_SVD_BD: // decrease backlight when pressing shift and vol up
+ if (record->event.pressed) {
+ if (get_mods() & MOD_MASK_SHIFT) {
+ register_code(KC_BRID);
+ } else if (get_mods() & MOD_MASK_CTRL) {
+ register_code(KC_MPRV);
+ } else {
+ register_code(KC_VOLD);
+ }
+ } else {
+ unregister_code(KC_BRID);
+ unregister_code(KC_MPRV);
+ unregister_code(KC_VOLD);
+ }
+ return false;
+ case KC_TAB_MPLY: // press tab or play/pause when ctrl is pressed
+ if (record->event.pressed) {
+ if (get_mods() & MOD_MASK_CTRL) {
+ register_code(KC_MPLY);
+ } else {
+ register_code(KC_TAB);
+ }
+ } else {
+ unregister_code(KC_MPLY);
+ unregister_code(KC_TAB);
+ }
+ return false;
+ case ALT_TAB:
+ if (record->event.pressed) {
+ if (!is_alt_tab_active) {
+ is_alt_tab_active = true;
+ add_mods(MOD_BIT(KC_LALT));
+ }
+ register_code(KC_TAB);
+ } else {
+ unregister_code(KC_TAB);
+ }
+ break;
+ case CTL_TAB:
+ if (record->event.pressed) {
+ if (!is_ctl_tab_active) {
+ is_ctl_tab_active = true;
+ add_mods(MOD_BIT(KC_LCTL));
+ }
+ register_code(KC_TAB);
+ } else {
+ unregister_code(KC_TAB);
+ }
+ break;
+ // the next case allows us to use alt_tab without a timer
+ case LT(_NAV, KC_SPC):
+ if (record->event.pressed) {
+ } else {
+ unregister_mods(MOD_LALT);
+ unregister_mods(MOD_LCTL);
+ is_alt_tab_active = false;
+ is_ctl_tab_active = false;
+ }
+ break;
+ case DE_ae:
+ if (record->event.pressed) {
+ uint8_t temp_mods = get_mods();
+ if ((get_mods() | get_oneshot_mods()) & MOD_MASK_SHIFT) {
+ clear_oneshot_mods();
+ clear_mods();
+ add_mods(MOD_BIT(KC_LALT));
+ tap_code(KC_P0);
+ tap_code(KC_P1);
+ tap_code(KC_P9);
+ tap_code(KC_P6); // Ä
+ } else {
+ clear_mods();
+ add_mods(MOD_BIT(KC_LALT));
+ tap_code(KC_P0);
+ tap_code(KC_P2);
+ tap_code(KC_P2);
+ tap_code(KC_P8); // ä
+ }
+ unregister_mods(MOD_LALT);
+ set_mods(temp_mods);
+ }
+ return false;
+ break;
+ case DE_AE:
+ if (record->event.pressed) {
+ uint8_t temp_mods = get_mods() | get_oneshot_mods();
+ clear_oneshot_mods();
+ clear_mods();
+ add_mods(MOD_BIT(KC_LALT));
+ tap_code(KC_P0);
+ tap_code(KC_P1);
+ tap_code(KC_P9);
+ tap_code(KC_P6); // Ä
+ unregister_mods(MOD_LALT);
+ set_mods(temp_mods);
+ }
+ return false;
+ break;
+ case DE_oe:
+ if (record->event.pressed) {
+ uint8_t temp_mods = get_mods();
+ if ((get_mods() | get_oneshot_mods()) & MOD_MASK_SHIFT) {
+ clear_oneshot_mods();
+ clear_mods();
+ add_mods(MOD_BIT(KC_LALT));
+ tap_code(KC_P0);
+ tap_code(KC_P2);
+ tap_code(KC_P1);
+ tap_code(KC_P4); // Ö
+ } else {
+ clear_mods();
+ add_mods(MOD_BIT(KC_LALT));
+ tap_code(KC_P0);
+ tap_code(KC_P2);
+ tap_code(KC_P4);
+ tap_code(KC_P6); // ö
+ }
+ unregister_mods(MOD_LALT);
+ set_mods(temp_mods);
+ }
+ return false;
+ break;
+ case DE_OE:
+ if (record->event.pressed) {
+ uint8_t temp_mods = get_mods() | get_oneshot_mods();
+ clear_oneshot_mods();
+ clear_mods();
+ add_mods(MOD_BIT(KC_LALT));
+ tap_code(KC_P0);
+ tap_code(KC_P2);
+ tap_code(KC_P1);
+ tap_code(KC_P4); // Ö
+ unregister_mods(MOD_LALT);
+ set_mods(temp_mods);
+ }
+ return false;
+ break;
+ case DE_ue:
+ if (record->event.pressed) {
+ uint8_t temp_mods = get_mods();
+ if ((get_mods() | get_oneshot_mods()) & MOD_MASK_SHIFT) {
+ clear_oneshot_mods();
+ clear_mods();
+ add_mods(MOD_BIT(KC_LALT));
+ tap_code(KC_P0);
+ tap_code(KC_P2);
+ tap_code(KC_P2);
+ tap_code(KC_P0); // Ü
+ } else {
+ clear_mods();
+ add_mods(MOD_BIT(KC_LALT));
+ tap_code(KC_P0);
+ tap_code(KC_P2);
+ tap_code(KC_P5);
+ tap_code(KC_P2); // ü
+ }
+ unregister_mods(MOD_LALT);
+ set_mods(temp_mods);
+ }
+ return false;
+ break;
+ case KC_DE_SWITCH:
+ if (record->event.pressed) {
+ if (de_layout_active) {
+ de_layout_active = false; // deactivate German overlay
+ set_single_persistent_default_layer(_HRWIDECOLEMAK);
+ } else {
+ de_layout_active = true; // activate German overlay
+ set_single_persistent_default_layer(_HRWIDECOLEMAK_DE);
+ }
+ return false;
+ }
+ break;
+ case LANG_SWITCH:
+ if (record->event.pressed) {
+ register_mods(MOD_LALT);
+ register_code(KC_LSFT);
+ if (de_layout_active) {
+ de_layout_active = false; // deactivate German overlay
+ set_single_persistent_default_layer(_HRWIDECOLEMAK);
+ } else {
+ de_layout_active = true; // activate German overlay
+ set_single_persistent_default_layer(_HRWIDECOLEMAK_DE);
+ }
+ } else {
+ unregister_code(KC_LSFT);
+ unregister_mods(MOD_LALT);
+ }
+ return false;
+ case DE_SZ:
+ if (record->event.pressed) {
+ uint8_t temp_mods = get_mods();
+ if ((get_mods() | get_oneshot_mods()) & MOD_MASK_SHIFT) {
+ clear_oneshot_mods();
+ clear_mods();
+ add_mods(MOD_BIT(KC_LALT));
+ tap_code(KC_P0);
+ tap_code(KC_P1);
+ tap_code(KC_P7);
+ tap_code(KC_P6); // °
+ } else {
+ clear_mods();
+ add_mods(MOD_BIT(KC_LALT));
+ tap_code(KC_P0);
+ tap_code(KC_P2);
+ tap_code(KC_P2);
+ tap_code(KC_P3); // ß
+ }
+ unregister_mods(MOD_LALT);
+ set_mods(temp_mods);
+ }
+ return false;
+ break;
+ case DE_EGRAVE:
+ if (record->event.pressed) {
+ uint8_t temp_mods = get_mods();
+ if ((get_mods() | get_oneshot_mods()) & MOD_MASK_SHIFT) {
+ clear_oneshot_mods();
+ clear_mods();
+ add_mods(MOD_BIT(KC_LALT));
+ tap_code(KC_P0);
+ tap_code(KC_P2);
+ tap_code(KC_P0);
+ tap_code(KC_P0); // È
+ } else {
+ clear_mods();
+ add_mods(MOD_BIT(KC_LALT));
+ tap_code(KC_P0);
+ tap_code(KC_P2);
+ tap_code(KC_P3);
+ tap_code(KC_P2); // è
+ }
+ unregister_mods(MOD_LALT);
+ set_mods(temp_mods);
+ }
+ return false;
+ break;
+ case DE_EAIGU:
+ if (record->event.pressed) {
+ uint8_t temp_mods = get_mods();
+ if ((get_mods() | get_one