planck: add planck (#2)

Co-authored-by: Michael Grote <michael.grote@posteo.de>
Co-committed-by: Michael Grote <michael.grote@posteo.de>
This commit is contained in:
Michael Grote 2024-08-18 20:36:48 +02:00 committed by Michael Grote
parent 52415ec56a
commit dcd5c66394
6 changed files with 256 additions and 9 deletions

View file

@ -4,7 +4,7 @@
// rgb
void keyboard_post_init_user(void) {
rgblight_enable_noeeprom(); // Enables RGB, without saving settings
rgblight_sethsv(4, 75, 150); // warmhite (werte = hue, saturation, value)
rgblight_sethsv(4, 75, 150); // warmwhite (werte = hue, saturation, value)
rgblight_mode_noeeprom(RGB_MATRIX_SOLID_COLOR);
}
bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
@ -125,21 +125,21 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[1] = LAYOUT_split_3x5_3(
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_BSPC,
KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,
QK_CAPS_WORD_TOGGLE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_F10, KC_F11, XXXXXXX, XXXXXXX, KC_F12,
QK_CAPS_WORD_TOGGLE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_F10, KC_F11, _______, _______, KC_F12,
XXXXXXX, _______, _______, _______, _______, XXXXXXX
),
// Sym - blue
[2] = LAYOUT_split_3x5_3(
DE_CIRC, DE_LBRC, DE_LPRN, DE_LPRN, DE_SECT, DE_PERC, DE_RCBR, DE_RPRN, DE_RBRC, KC_BSPC,
DE_EXLM, DE_DQUO, DE_SS, DE_QUOT, DE_SLSH, RALT(DE_SS), DE_DLR, DE_AMPR, DE_ASTR, DE_QUES,
DE_TILD, DE_ACUT, XXXXXXX, LSFT(DE_ACUT), DE_LABK , DE_RABK , XXXXXXX, DE_PLUS, DE_EQL, DE_HASH,
DE_CIRC, DE_LBRC, DE_LPRN, DE_LPRN, DE_SECT, DE_PERC, DE_RCBR, DE_RPRN, DE_RBRC, KC_BSPC,
DE_EXLM, DE_DQUO, DE_SS, DE_QUOT, DE_SLSH, RALT(DE_SS), DE_DLR, DE_AMPR, DE_ASTR, DE_QUES,
DE_TILD, DE_ACUT, XXXXXXX, LSFT(DE_ACUT), DE_LABK , DE_RABK , XXXXXXX, DE_PLUS, DE_EQL, DE_HASH,
XXXXXXX, _______, _______, _______, _______, XXXXXXX
),
// Move - green
[3] = LAYOUT_split_3x5_3(
XXXXXXX, KC_HOME, KC_UP, KC_PGUP, XXXXXXX, XXXXXXX, KC_PGUP, KC_UP, KC_HOME, KC_BSPC,
KC_TAB, KC_LEFT, KC_DOWN, KC_RIGHT, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RIGHT, KC_DEL,
XXXXXXX, KC_END, KC_PGDN, XXXXXXX, XXXXXXX, XXXXXXX, KC_PGDN, XXXXXXX, KC_END, XXXXXXX,
XXXXXXX, KC_HOME, KC_UP, KC_PGUP, XXXXXXX, XXXXXXX, KC_PGUP, KC_UP, KC_HOME, KC_BSPC,
KC_TAB, KC_LEFT, KC_DOWN, KC_RIGHT, XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RIGHT, KC_DEL,
XXXXXXX, KC_END, KC_PGDN, XXXXXXX, XXXXXXX, XXXXXXX, KC_PGDN, XXXXXXX, KC_END, XXXXXXX,
XXXXXXX, _______, _______, _______, _______, XXXXXXX
),
// Media - yellow

View file

@ -43,7 +43,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[1] = LAYOUT_split_3x5_2(
KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_BSPC,
KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0,
QK_CAPS_WORD_TOGGLE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_F10, KC_F11, XXXXXXX, XXXXXXX, KC_F12,
QK_CAPS_WORD_TOGGLE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_F10, KC_F11, _______, _______, KC_F12,
_______, _______, _______, _______
),
// Sym - blue

View file

@ -0,0 +1,15 @@
// tap and hold
#define TAPPING_TERM 175 //in milliseconds
#define PERMISSIVE_HOLD
// autoshift
#define NO_AUTO_SHIFT_TAB
#define NO_AUTO_SHIFT_NUMERIC
#define NO_AUTO_SHIFT_ALPHA
// rgb
#define RGB_MATRIX_STARTUP_MODE RGB_MATRIX_SOLID_COLOR
#define RGB_DISABLE_WHEN_USB_SUSPENDED true
#undef RGB_MATRIX_MAXIMUM_BRIGHTNESS
#define RGB_MATRIX_MAXIMUM_BRIGHTNESS 220
#define RGB_TRIGGER_ON_KEYDOWN // Triggers RGB keypress events on key down. This makes RGB control feel more responsive. This may cause RGB to not function properly on some boards
// rgb timeout; https://gist.github.com/aashreys/01cb34605a290a7cfb94a856bdabc94c?permalink_comment_id=4520204#gistcomment-4520204
#define RGB_MATRIX_TIMEOUT 180000 // = 3min; number of milliseconds to wait until rgb automatically turns off

View file

@ -0,0 +1,223 @@
#include QMK_KEYBOARD_H
#include "keymap_german.h"
// rgb
void keyboard_post_init_user(void) {
rgblight_enable_noeeprom(); // Enables RGB, without saving settings
rgblight_sethsv(0, 0, 0); // pure white (werte = hue, saturation, value)
rgblight_mode_noeeprom(RGB_MATRIX_SOLID_COLOR);
}
bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) {
// https://colorpicker.me/#fff115
// layer rgb
//../../ez/ez.c
// { 0, 1, 2, 3, 4, 5 }, { 6, 7, 8, 9, 10, 11 },
// { 12, 13, 14, 15, 16, 17 }, { 18, 19, 20, 21, 22, 23 },
// { 24, 25, 26, 27, 28, 29 }, { 30, 31, 32, 33, 34, 35 },
// { 36, 37, 38, 45, 46, NO_LED }, { 42, 43, 44, 39, 40, 41 }
// arrays of LED indexes
const uint8_t led_sym_indexes[16] = {1, 5, 6, 10, 13, 14, 15, 16, 19, 20, 21, 22, 25, 32, 33, 34};
const uint8_t led_mov_indexes[20] = {2, 3, 4, 7, 8, 9, 10, 11, 13, 14, 15, 16, 19, 20, 21, 22, 26, 27, 31, 33};
const uint8_t led_media_indexes[6] = {1, 4, 5, 17, 28, 29};
const uint8_t led_border_indexes[17] = {0, 12, 24, 36, 37, 38, 45, 46, 42, 43, 44, 39, 40, 41, 35, 23, 11};
for (uint8_t i = led_min; i < led_max; i++) {
switch(get_highest_layer(layer_state|default_layer_state)) {
//base
case 0:
// All
for (int i=0; i<=46; i++) {
rgb_matrix_set_color(i, 24, 158, 230); // blue
}
// only border
for (int i=0; i<17; i++) {
rgb_matrix_set_color(led_border_indexes[i], 255, 88, 0); // orange
}
break;
// num
case 1:
// https://www.reddit.com/r/olkb/comments/o3x5o6/how_to_do_a_basic_loop_in_qmkc/
//F-Keys
for (int i=1; i<=10; i++) {
rgb_matrix_set_color(i, 20, 214, 2);
}
for (int i=33; i<=34; i++) {
rgb_matrix_set_color(i, 20, 214, 2);
}
// Numbers
for (int i=13; i<=22; i++) {
rgb_matrix_set_color(i, 44, 0, 232); // 50 shades of blue
}
// capsword
rgb_matrix_set_color(25, 235, 235, 19); // 50 shades of yellow
// only border
for (int i=0; i<17; i++) {
rgb_matrix_set_color(led_border_indexes[i], 255, 88, 0); // orange
}
break;
// sym
case 2:
// color pairs
// ´`
rgb_matrix_set_color(26, 20, 214, 22); // 50 shades of green
rgb_matrix_set_color(28, 20, 214, 22); // 50 shades of green
// []
rgb_matrix_set_color(2, 44, 0, 232); // 50 shades of blue
rgb_matrix_set_color(9, 44, 0, 232); // 50 shades of blue
// ()
rgb_matrix_set_color(3, 44, 0, 207); // 50 shades of blue
rgb_matrix_set_color(8, 44, 0, 207); // 50 shades of blue
// {}
rgb_matrix_set_color(4, 44, 0, 171); // 50 shades of blue
rgb_matrix_set_color(7, 44, 0, 171); // 50 shades of blue
// \/
rgb_matrix_set_color(17, 235, 235, 19); // 50 shades of yellow
rgb_matrix_set_color(18, 235, 235, 19); // 50 shades of yellow
// <>
rgb_matrix_set_color(29, 235, 56, 19); // 50 shades of red
rgb_matrix_set_color(30, 235, 56, 19); // 50 shades of red
// rest
for (int i=0; i<16; i++) {
rgb_matrix_set_color(led_sym_indexes[i], 234, 221, 13); // other yellow
}
// only border
for (int i=0; i<17; i++) {
rgb_matrix_set_color(led_border_indexes[i], 255, 88, 0); // orange
}
break;
// mov
case 3:
for (int i=0; i<20; i++) {
rgb_matrix_set_color(led_mov_indexes[i], 4, 147, 4); // green
}
// only border
for (int i=0; i<17; i++) {
rgb_matrix_set_color(led_border_indexes[i], 255, 88, 0); // orange
}
break;
// media
case 4:
for (int i=0; i<6; i++) {
rgb_matrix_set_color(led_media_indexes[i], 235, 56, 19); // 50 shades of red
}
// only border
for (int i=0; i<17; i++) {
rgb_matrix_set_color(led_border_indexes[i], 255, 88, 0); // orange
}
break;
default:
break;
}
}
return false;
}
// combos; https://github.com/qmk/qmk_firmware/blob/master/docs/feature_combo.md
enum combos {
C_MED,
};
const uint16_t PROGMEM med_combo[] = {KC_DEL, KC_LEFT, COMBO_END};
combo_t key_combos[] = {
[C_MED] = COMBO(med_combo, MO(4)),
};
// keymap
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
// Buchstaben - white
[0] = LAYOUT_planck_mit(
KC_ESC, LT(0,KC_Q), KC_W, LT(0,KC_F), KC_P, KC_B, KC_J, KC_L, LT(0,KC_U), DE_Z, XXXXXXX, KC_BSPC,
KC_TAB, LT(0,KC_A), KC_R, KC_S, KC_T, KC_G, KC_M, KC_N, KC_E, KC_I, LT(0,KC_O), KC_ENT,
KC_LSFT, LT(0,DE_Y), LT(0,KC_X), LT(0,KC_C), KC_D, LT(0,KC_V), KC_K, KC_H, DE_COMM, DE_DOT, DE_MINS, DE_HASH,
KC_LCTL, KC_LGUI, KC_LALT, KC_DEL, MO(2), LT(3, KC_SPC), MO(1), KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT
),
// Zahlen - orange
[1] = LAYOUT_planck_mit(
KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_BSPC,
KC_TAB, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_ENT,
KC_LSFT, QK_CAPS_WORD_TOGGLE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, KC_F11, KC_F12, DE_HASH,
KC_LCTL, KC_LGUI, KC_LALT, KC_DEL, MO(2), KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT
),
// Sym - blue
[2] = LAYOUT_planck_mit(
KC_ESC, DE_CIRC, DE_LBRC, DE_LPRN, DE_LPRN, DE_SECT, DE_PERC, DE_RCBR, DE_RPRN, DE_RBRC, KC_BSPC, KC_BSPC,
KC_TAB, DE_EXLM, DE_DQUO, DE_SS, DE_QUOT, DE_SLSH, RALT(DE_SS), DE_DLR, DE_AMPR, DE_ASTR, DE_QUES, KC_ENT,
KC_LSFT, DE_TILD, DE_ACUT, XXXXXXX, LSFT(DE_ACUT), DE_LABK, DE_RABK, XXXXXXX, DE_PLUS, DE_EQL, DE_HASH, XXXXXXX,
KC_LCTL, KC_LGUI, KC_LALT, KC_DEL, MO(2), KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT
),
// Move - green
[3] = LAYOUT_planck_mit(
KC_ESC, XXXXXXX, KC_HOME, KC_UP, KC_PGUP, XXXXXXX, XXXXXXX, KC_PGUP, KC_UP, KC_HOME, KC_BSPC, KC_BSPC,
KC_TAB, KC_TAB, KC_LEFT, KC_DOWN, KC_RIGHT,XXXXXXX, XXXXXXX, KC_LEFT, KC_DOWN, KC_RIGHT, KC_DEL, KC_ENT,
KC_LSFT, XXXXXXX, KC_END, KC_PGDN, XXXXXXX, XXXXXXX, XXXXXXX, KC_PGDN, XXXXXXX, KC_END, XXXXXXX, XXXXXXX,
KC_LCTL, KC_LGUI, KC_LALT, KC_DEL, MO(2), KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT
),
// Media - yellow
[4] = LAYOUT_planck_mit(
KC_ESC, RGB_TOG, XXXXXXX, XXXXXXX, KC_PSCR, KC_VOLU, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_BSPC,
KC_TAB, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_MUTE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_ENT,
KC_LSFT, XXXXXXX, XXXXXXX, XXXXXXX, KC_MPLY, KC_VOLD, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX,
KC_LCTL, KC_LGUI, KC_LALT, KC_DEL, MO(2), KC_SPC, MO(1), KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT
)
};
// https://github.com/qmk/qmk_firmware/blob/master/docs/mod_tap.md#changing-hold-function
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) {
// "Tap and Hold"
case LT(0,KC_X): // "LT(0,KC_X)" is the keycode that must be mapped
if (!record->tap.count && record->event.pressed) {
tap_code16(LCTL(KC_X)); // Intercept hold function to send Ctrl-X
return false;
}
return true; // Return true for normal processing of tap keycode
case LT(0,DE_Y):
if (!record->tap.count && record->event.pressed) {
tap_code16(DE_PIPE);
return false;
}
return true;
case LT(0,KC_C):
if (!record->tap.count && record->event.pressed) {
tap_code16(LCTL(KC_C));
return false;
}
return true;
case LT(0,KC_V):
if (!record->tap.count && record->event.pressed) {
tap_code16(LCTL(KC_V));
return false;
}
return true;
case LT(0,KC_Q):
if (!record->tap.count && record->event.pressed) {
tap_code16(RALT(KC_Q));
return false;
}
return true;
case LT(0,KC_F):
if (!record->tap.count && record->event.pressed) {
tap_code16(RALT(KC_E));
return false;
}
return true;
case LT(0,KC_A):
if (!record->tap.count && record->event.pressed) {
tap_code16(DE_ADIA);
return false;
}
return true;
case LT(0,KC_O):
if (!record->tap.count && record->event.pressed) {
tap_code16(DE_ODIA);
return false;
}
return true;
case LT(0,KC_U):
if (!record->tap.count && record->event.pressed) {
tap_code16(DE_UDIA);
return false;
}
return true;
}
return true;
}

View file

@ -0,0 +1,4 @@
CAPS_WORD_ENABLE = yes
AUTO_SHIFT_ENABLE = yes
COMBO_ENABLE = yes
RGB_MATRIX_ENABLE = yes

View file

@ -111,6 +111,7 @@ Combos 3/3
```bash
qmk compile -kb ferris/sweep -km quotengrote
qmk compile -kb bastardkb/skeletyl/v2/splinky_3 -km quotengrote
qmk compile -kb planck/ez -km quotengrote
```
## Rebase
@ -130,3 +131,7 @@ qmk compile -kb ferris/sweep -km quotengrote
qmk compile -kb bastardkb/skeletyl/v2/splinky_3 -km quotengrote
git push -f
```
## Misc
[Oryx - Planck](https://configure.zsa.io/planck-ez/layouts/BOMNA/latest/0)