2022-10-10 16:58:32 +02:00
|
|
|
/* Copyright 2022 Christoph Cullmann
|
2022-10-01 11:03:31 +02:00
|
|
|
*
|
|
|
|
* 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
|
|
|
|
|
2022-10-01 16:34:28 +02:00
|
|
|
// our layers, used as index in layers and rgb lights
|
2022-10-01 11:03:31 +02:00
|
|
|
enum planck_layers {
|
|
|
|
_QWERTY,
|
|
|
|
_LOWER,
|
|
|
|
_RAISE,
|
|
|
|
_NAV,
|
|
|
|
_CMD,
|
|
|
|
_FN
|
|
|
|
};
|
|
|
|
|
|
|
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|
|
|
|
|
|
|
/* Qwerty
|
|
|
|
* ,-----------------------------------------------------------------------------------.
|
2022-10-07 17:25:38 +02:00
|
|
|
* | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
|
2022-10-01 11:03:31 +02:00
|
|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
2022-10-04 19:34:41 +02:00
|
|
|
* | Ctrl | A | S | D | F | G | H | J | K | L | ; | ' |
|
2022-10-01 11:03:31 +02:00
|
|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
2022-10-04 19:34:41 +02:00
|
|
|
* | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
|
2022-10-01 11:03:31 +02:00
|
|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
2022-10-04 19:34:41 +02:00
|
|
|
* | Ctrl | GUI | Alt | Cmd | |Space | | Bksp | Fn | Alt | GUI | Ctrl |
|
2022-10-01 11:03:31 +02:00
|
|
|
* `-----------------------------------------------------------------------------------'
|
|
|
|
*/
|
|
|
|
[_QWERTY] = LAYOUT_planck_grid(
|
2022-10-05 22:21:45 +02:00
|
|
|
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
|
2022-10-10 16:58:32 +02:00
|
|
|
LCTL_T(KC_ESC), KC_A, RALT_T(KC_S), LALT_T(KC_D), LSFT_T(KC_F), KC_G, KC_H, RSFT_T(KC_J), LALT_T(KC_K), RALT_T(KC_L), LT(_NAV, KC_SCLN), RCTL_T(KC_QUOT),
|
2022-10-07 17:25:38 +02:00
|
|
|
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, RSFT_T(KC_ENT),
|
2022-10-05 22:21:45 +02:00
|
|
|
KC_LCTL, KC_LGUI, KC_LALT, MO(_CMD), MO(_LOWER), KC_SPC, KC_ENT, MO(_RAISE), MO(_FN), KC_RALT, KC_RGUI, KC_RCTL
|
2022-10-01 11:03:31 +02:00
|
|
|
),
|
|
|
|
|
|
|
|
/* Lower
|
|
|
|
* ,-----------------------------------------------------------------------------------.
|
2022-10-04 19:34:41 +02:00
|
|
|
* | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | |
|
2022-10-01 11:03:31 +02:00
|
|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
|
|
|
* | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | |
|
|
|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
|
|
|
* | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | |
|
|
|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
2022-10-04 19:34:41 +02:00
|
|
|
* | | | | | | | | | | | | |
|
2022-10-01 11:03:31 +02:00
|
|
|
* `-----------------------------------------------------------------------------------'
|
|
|
|
*/
|
|
|
|
[_LOWER] = LAYOUT_planck_grid(
|
2022-10-01 17:33:34 +02:00
|
|
|
KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, _______,
|
2022-10-01 11:03:31 +02:00
|
|
|
KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE,
|
|
|
|
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______,
|
2022-10-01 17:56:00 +02:00
|
|
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
2022-10-01 11:03:31 +02:00
|
|
|
),
|
|
|
|
|
|
|
|
/* Raise
|
|
|
|
* ,-----------------------------------------------------------------------------------.
|
2022-10-04 19:34:41 +02:00
|
|
|
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | |
|
2022-10-01 11:03:31 +02:00
|
|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
|
|
|
* | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ |
|
|
|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
|
|
|
* | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | |
|
|
|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
2022-10-04 19:34:41 +02:00
|
|
|
* | | | | | | | | | | | | |
|
2022-10-01 11:03:31 +02:00
|
|
|
* `-----------------------------------------------------------------------------------'
|
|
|
|
*/
|
|
|
|
[_RAISE] = LAYOUT_planck_grid(
|
2022-10-01 17:33:34 +02:00
|
|
|
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______,
|
2022-10-01 11:03:31 +02:00
|
|
|
KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS,
|
|
|
|
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______,
|
2022-10-01 17:56:00 +02:00
|
|
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
2022-10-01 11:03:31 +02:00
|
|
|
),
|
|
|
|
|
|
|
|
/* Navigation layer
|
|
|
|
* ,-----------------------------------------------------------------------------------.
|
|
|
|
* | | | | | | | | | Up | | | |
|
|
|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
|
|
|
* | | Home | PgUp | PgDn | End | | | Left | Down | Right| | |
|
|
|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
|
|
|
* | | | | | | | | | | | | |
|
|
|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
|
|
|
* | | | | | | | | | | | | |
|
|
|
|
* `-----------------------------------------------------------------------------------'
|
|
|
|
*/
|
|
|
|
[_NAV] = LAYOUT_planck_grid(
|
|
|
|
_______, _______, _______, _______, _______, _______, _______, _______, KC_UP, _______, _______, _______,
|
|
|
|
_______, KC_HOME, KC_PGUP, KC_PGDN, KC_END, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______,
|
|
|
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
2022-10-01 17:56:00 +02:00
|
|
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
2022-10-01 11:03:31 +02:00
|
|
|
),
|
|
|
|
|
|
|
|
/* Command layer
|
|
|
|
* ,-----------------------------------------------------------------------------------.
|
2022-10-01 17:54:59 +02:00
|
|
|
* | | | | | | | | | | | |
|
2022-10-01 11:03:31 +02:00
|
|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
2022-10-01 17:59:53 +02:00
|
|
|
* |Print | | | | | | | | | | |
|
2022-10-01 11:03:31 +02:00
|
|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
2022-10-01 17:54:59 +02:00
|
|
|
* | | | | | | | | | | | |
|
2022-10-01 11:03:31 +02:00
|
|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
|
|
|
* | | | | | | | | | | | |
|
|
|
|
* `-----------------------------------------------------------------------------------'
|
|
|
|
*/
|
|
|
|
[_CMD] = LAYOUT_planck_grid(
|
2022-10-01 17:54:59 +02:00
|
|
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
2022-10-01 17:59:53 +02:00
|
|
|
KC_PSCR, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
2022-10-01 17:54:59 +02:00
|
|
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
2022-10-01 17:56:00 +02:00
|
|
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
2022-10-01 11:03:31 +02:00
|
|
|
),
|
|
|
|
|
|
|
|
/*
|
|
|
|
* Function layer
|
2022-10-01 17:54:59 +02:00
|
|
|
* v------------------------RGB CONTROL--------------------v
|
2022-10-01 11:03:31 +02:00
|
|
|
* ,-----------------------------------------------------------------------------------.
|
2022-10-05 22:21:45 +02:00
|
|
|
* | Boot | | RGB |RGBMOD| HUE+ | HUE- | SAT+ | SAT- |BRGTH+|BRGTH-| |Reboot|
|
2022-10-01 11:03:31 +02:00
|
|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
2022-10-05 22:21:45 +02:00
|
|
|
* | | | | | | | | | | | |
|
2022-10-01 11:03:31 +02:00
|
|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
2022-10-02 17:43:07 +02:00
|
|
|
* | | | | | | | | | | | |
|
2022-10-01 11:03:31 +02:00
|
|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
|
|
|
* | | | | | | | | | | | |
|
|
|
|
* `-----------------------------------------------------------------------------------'
|
|
|
|
*/
|
|
|
|
[_FN] = LAYOUT_planck_grid(
|
2022-10-05 22:21:45 +02:00
|
|
|
QK_BOOT, _______, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, _______, QK_RBT,
|
|
|
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
2022-10-02 17:43:07 +02:00
|
|
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
|
2022-10-01 17:56:00 +02:00
|
|
|
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
|
2022-10-01 11:03:31 +02:00
|
|
|
)
|
|
|
|
|
|
|
|
};
|
2022-10-01 16:34:28 +02:00
|
|
|
|
2022-10-10 16:58:32 +02:00
|
|
|
// per-key tapping term
|
|
|
|
uint16_t get_tapping_term(uint16_t keycode, keyrecord_t *record) {
|
|
|
|
switch (keycode) {
|
|
|
|
case RALT_T(KC_S):
|
|
|
|
case LALT_T(KC_D):
|
|
|
|
case LSFT_T(KC_F):
|
|
|
|
case RSFT_T(KC_J):
|
|
|
|
case LALT_T(KC_K):
|
|
|
|
case RALT_T(KC_L):
|
|
|
|
return TAPPING_TERM_HOME_ROW;
|
|
|
|
default:
|
|
|
|
return TAPPING_TERM;
|
|
|
|
}
|
|
|
|
}
|
2022-10-01 16:34:28 +02:00
|
|
|
|
|
|
|
/* plwnck rev6 RGB layout:
|
|
|
|
* ----------------------------------
|
|
|
|
* | 6 5 4 3 |
|
|
|
|
* | 0 |
|
|
|
|
* | 7 8 1 2 |
|
|
|
|
* ----------------------------------
|
|
|
|
*/
|
|
|
|
|
2022-10-01 18:09:51 +02:00
|
|
|
const rgblight_segment_t PROGMEM qwerty_layer[] = RGBLIGHT_LAYER_SEGMENTS(
|
|
|
|
{1, 8, HSV_WHITE}
|
2022-10-01 16:34:28 +02:00
|
|
|
);
|
|
|
|
|
2022-10-01 18:09:51 +02:00
|
|
|
const rgblight_segment_t PROGMEM lower_layer[] = RGBLIGHT_LAYER_SEGMENTS(
|
|
|
|
{1, 8, HSV_BLUE}
|
2022-10-01 16:34:28 +02:00
|
|
|
);
|
|
|
|
|
2022-10-01 18:09:51 +02:00
|
|
|
const rgblight_segment_t PROGMEM raise_layer[] = RGBLIGHT_LAYER_SEGMENTS(
|
|
|
|
{1, 8, HSV_YELLOW}
|
2022-10-01 16:34:28 +02:00
|
|
|
);
|
|
|
|
|
2022-10-01 18:09:51 +02:00
|
|
|
const rgblight_segment_t PROGMEM nav_layer[] = RGBLIGHT_LAYER_SEGMENTS(
|
|
|
|
{1, 8, HSV_WHITE}
|
2022-10-01 16:34:28 +02:00
|
|
|
);
|
|
|
|
|
2022-10-01 18:09:51 +02:00
|
|
|
const rgblight_segment_t PROGMEM cmd_layer[] = RGBLIGHT_LAYER_SEGMENTS(
|
|
|
|
{1, 8, HSV_GREEN}
|
2022-10-01 16:34:28 +02:00
|
|
|
);
|
|
|
|
|
2022-10-01 18:09:51 +02:00
|
|
|
const rgblight_segment_t PROGMEM fn_layer[] = RGBLIGHT_LAYER_SEGMENTS(
|
|
|
|
{1, 8, HSV_RED}
|
2022-10-01 16:34:28 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
const rgblight_segment_t * const PROGMEM my_rgb_layers[] = RGBLIGHT_LAYERS_LIST(
|
2022-10-01 18:09:51 +02:00
|
|
|
[_QWERTY] = qwerty_layer,
|
2022-10-01 16:34:28 +02:00
|
|
|
[_LOWER] = lower_layer,
|
|
|
|
[_RAISE] = raise_layer,
|
2022-10-01 18:09:51 +02:00
|
|
|
[_NAV] = nav_layer,
|
|
|
|
[_CMD] = cmd_layer,
|
|
|
|
[_FN] = fn_layer
|
2022-10-01 16:34:28 +02:00
|
|
|
);
|
|
|
|
|
|
|
|
void keyboard_post_init_user(void) {
|
|
|
|
// Enable the LED layers
|
|
|
|
rgblight_layers = my_rgb_layers;
|
|
|
|
}
|
|
|
|
|
|
|
|
layer_state_t layer_state_set_user(layer_state_t state)
|
|
|
|
{
|
|
|
|
rgblight_set_layer_state(_LOWER, layer_state_cmp(state, _LOWER));
|
|
|
|
rgblight_set_layer_state(_RAISE, layer_state_cmp(state, _RAISE));
|
|
|
|
rgblight_set_layer_state(_NAV, layer_state_cmp(state, _NAV));
|
|
|
|
rgblight_set_layer_state(_CMD, layer_state_cmp(state, _CMD));
|
|
|
|
rgblight_set_layer_state(_FN, layer_state_cmp(state, _FN));
|
|
|
|
return state;
|
|
|
|
}
|