diff options
author | Konstantin Đorđević <vomindoraan@gmail.com> | 2019-05-06 17:41:45 +0200 |
---|---|---|
committer | Drashna Jaelre <drashna@live.com> | 2019-05-06 08:41:45 -0700 |
commit | cb1935aaff0fed118954996fc7afb722b6ed21be (patch) | |
tree | 753712b2dff56ca41675a99af8f3ffcaf58b85b9 | |
parent | 8a9c90ad78305a1d76663fcb973a1a2ae7177297 (diff) |
[Keymap] Update personal userspace and keymaps (now with 4 spaces!) (#5774)
* Add FnLk to Melody96 bottom row
* Update conditional in userspace makefile
Thanks @drashna
* Add F keys to Melody96 Fn layer
* Add FN_ESC alias to userspace
* Update KBD6X keymap
* Fix RGB_MATRIX_ENABLE constant name in #if
* Remove trailing \ from LAYOUT macro calls
* Set RGB mode on EEPROM reset in KBD6X
* Swap right and middle mouse buttons in KBD6X
* Rearrange RGB controls in KBD6X
* Update keycode aliases, replace CLEAR with DEL_NXT in KBD6X
Add Clear to KBD6X as RCtrl+`
* Convert code to 4 space indents
* Tweak RCTRL layer functionality
* Replace NUMPAD custom keycode with layer state logic
* Update RGB_MATRIX_ENABLE check
Co-Authored-By: vomindoraan <vomindoraan@gmail.com>
-rw-r--r-- | keyboards/kbdfans/kbd6x/keymaps/konstantin/keymap.c | 154 | ||||
-rw-r--r-- | keyboards/kbdfans/kbd6x/keymaps/konstantin/rules.mk | 8 | ||||
-rw-r--r-- | keyboards/melody96/keymaps/konstantin/keymap.c | 124 | ||||
-rw-r--r-- | keyboards/whitefox/keymaps/konstantin/keymap.c | 120 | ||||
-rw-r--r-- | users/konstantin/konstantin.c | 120 | ||||
-rw-r--r-- | users/konstantin/konstantin.h | 60 | ||||
-rw-r--r-- | users/konstantin/rgb.h | 12 | ||||
-rw-r--r-- | users/konstantin/rules.mk | 13 | ||||
-rw-r--r-- | users/konstantin/tap_dance.c | 166 | ||||
-rw-r--r-- | users/konstantin/tap_dance.h | 14 | ||||
-rw-r--r-- | users/konstantin/unicode.c | 2 | ||||
-rw-r--r-- | users/konstantin/unicode.h | 20 |
12 files changed, 408 insertions, 405 deletions
diff --git a/keyboards/kbdfans/kbd6x/keymaps/konstantin/keymap.c b/keyboards/kbdfans/kbd6x/keymaps/konstantin/keymap.c index 3404cc4e49..bb8ab6b9b3 100644 --- a/keyboards/kbdfans/kbd6x/keymaps/konstantin/keymap.c +++ b/keyboards/kbdfans/kbd6x/keymaps/konstantin/keymap.c @@ -2,91 +2,95 @@ #include "konstantin.h" enum keycodes_keymap { - RCTRL = RANGE_KEYMAP, + RCTRL = RANGE_KEYMAP, }; enum layers_keymap { - L_RCTRL = L_RANGE_KEYMAP, + L_RCTRL = L_RANGE_KEYMAP, }; +void eeconfig_init_keymap(void) { + rgblight_mode(RGBLIGHT_MODE_RAINBOW_SWIRL); +} + bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case RCTRL: - if (record->event.pressed) { - layer_on(L_RCTRL); - register_code(KC_RCTRL); - } else { - layer_off(L_RCTRL); - unregister_code(KC_RCTRL); - } - return false; + switch (keycode) { + case RCTRL: + if (record->event.pressed) { + register_code(KC_RCTRL); + layer_on(L_RCTRL); + } else { + unregister_code(KC_RCTRL); + layer_off(L_RCTRL); + } + return false; - default: - return true; - } + default: + return true; + } } const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Base layer - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ - * │Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ \ │ ` │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ - * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │Bspc │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │LCtCps│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ Enter │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ - * │LShiftFn│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │RShift│FnL│ - * └─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┘ - * │LGu│LAlt │ Space │RAlGu│RCt│ - * └───┴─────┴───────────────────────────┴─────┴───┘ - */ - [L_BASE] = LAYOUT( - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, - LCT_CPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, - LSFT_FN, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, FN_FNLK, - XXXXXXX, KC_LGUI, KC_LALT, KC_SPC, RAL_RGU, RCTRL, XXXXXXX - ), + /* Base layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ \ │ ` │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │Bspc │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │LCtCps│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ Enter │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ + * │LShiftFn│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │RShift│FnL│ + * └─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┘ + * │LGu│LAlt │ Space │RAlGu│RCt│ + * └───┴─────┴───────────────────────────┴─────┴───┘ + */ + [L_BASE] = LAYOUT( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, + LCT_CPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, + LSFT_FN, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, FN_FNLK, + XXXXXXX, KC_LGUI, KC_LALT, KC_SPC, RAL_RGU, RCTRL, XXXXXXX + ), - /* Function layer - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ - * │ │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│PSc│Ins│ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ - * │ │Hom│ ↑ │End│PgU│ │ │ │ │M1 │M↑ │M2 │M3 │ Del │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │ │ ← │ ↓ │ → │PgD│ │ │ │MW↑│M← │M↓ │M→ │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ - * │ │Mut│Vo-│Vo+│Ply│Prv│Nxt│MW←│MW→│M4 │M5 │ │ │ - * └─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┘ - * │DPR│DstNA│ MW↓ │MAcl2│ │ - * └───┴─────┴───────────────────────────┴─────┴───┘ - */ - [L_FN] = LAYOUT( - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_INS, - _______, KC_HOME, KC_UP, KC_END, KC_PGUP, _______, _______, _______, _______, KC_BTN1, KC_MS_U, KC_BTN2, KC_BTN3, KC_DEL, - _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, _______, _______, KC_WH_U, KC_MS_L, KC_MS_D, KC_MS_R, _______, - _______, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPLY, KC_MPRV, KC_MNXT, KC_WH_L, KC_WH_R, KC_BTN4, KC_BTN5, _______, _______, - XXXXXXX, DST_P_R, DST_N_A, KC_WH_D, KC_ACL2, _______, XXXXXXX - ), + /* Function layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │ │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│PSc│Ins│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ + * │ │Hom│ ↑ │End│PgU│ │ │ │ │M1 │M↑ │M3 │M2 │ Del │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │ ← │ ↓ │ → │PgD│ │ │ │MW↑│M← │M↓ │M→ │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ + * │ │Mut│Vo-│Vo+│Ply│Prv│Nxt│MW←│MW→│M4 │M5 │ │ │ + * └─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┘ + * │ │ │ MW↓ │MAcl2│ │ + * └───┴─────┴───────────────────────────┴─────┴───┘ + */ + [L_FN] = LAYOUT( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_INS, + _______, KC_HOME, KC_UP, KC_END, KC_PGUP, _______, _______, _______, _______, KC_BTN1, KC_MS_U, KC_BTN3, KC_BTN2, KC_DEL, + _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, _______, _______, _______, KC_WH_U, KC_MS_L, KC_MS_D, KC_MS_R, _______, + _______, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPLY, KC_MPRV, KC_MNXT, KC_WH_L, KC_WH_R, KC_BTN4, KC_BTN5, _______, _______, + XXXXXXX, _______, _______, KC_WH_D, KC_ACL2, _______, XXXXXXX + ), - /* RCtrl layer - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ - * │ │Top│Mv↑│Btm│PrT│ │ │ │ │ │ │ │ │Clear│ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ - * │ │Mv←│Mv↓│Mv→│NxT│ │ │ │ │ │ │ │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ - * └─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┘ - * │DtR│DstA │ │ │ │ - * └───┴─────┴───────────────────────────┴─────┴───┘ - */ - [L_RCTRL] = LAYOUT( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, TOP, MV_UP, BOTTOM, PRV_TAB, _______, _______, _______, _______, _______, _______, _______, _______, CLEAR, - _______, MV_LEFT, MV_DOWN, MV_RGHT, NXT_TAB, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - XXXXXXX, DST_REM, DST_ADD, _______, _______, _______, XXXXXXX - ), + /* RCtrl layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │Clr│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┤ + * │ │Top│Mv↑│Btm│TPr│ │ │ │ │ │ │ │ │DelNx│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┤ + * │ │Mv←│Mv↓│Mv→│TNx│ │ │ │ │ │ │ │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┤ + * │ │RTg│RV-│RV+│ │ │ │ │ │ │ │ │ │ + * └─────┬──┴┬──┴──┬┴───┴───┴───┴───┴───┴───┴──┬┴───┴┬───┬─┴───┘ + * │DPR│DstNA│ │ │ │ + * └───┴─────┴───────────────────────────┴─────┴───┘ + */ + [L_RCTRL] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, CLEAR, + _______, TOP, MV_UP, BOTTOM, TAB_PRV, _______, _______, _______, _______, _______, _______, _______, _______, DEL_NXT, + _______, MV_LEFT, MV_DOWN, MV_RGHT, TAB_NXT, _______, _______, _______, _______, _______, _______, _______, _______, + _______, RGB_TOG, RGB_VAD, RGB_VAI, _______, _______, _______, _______, _______, _______, _______, _______, _______, + XXXXXXX, DST_P_R, DST_N_A, _______, _______, _______, XXXXXXX + ), }; diff --git a/keyboards/kbdfans/kbd6x/keymaps/konstantin/rules.mk b/keyboards/kbdfans/kbd6x/keymaps/konstantin/rules.mk index 4e485bf766..f7cf0758b7 100644 --- a/keyboards/kbdfans/kbd6x/keymaps/konstantin/rules.mk +++ b/keyboards/kbdfans/kbd6x/keymaps/konstantin/rules.mk @@ -1,11 +1,11 @@ BOOTMAGIC_ENABLE = no COMMAND_ENABLE = yes -CONSOLE_ENABLE = yes +CONSOLE_ENABLE = no EXTRAKEY_ENABLE = yes MOUSEKEY_ENABLE = yes NKRO_ENABLE = yes TAP_DANCE_ENABLE = yes -UNICODEMAP_ENABLE = yes +UNICODEMAP_ENABLE = no -BACKLIGHT_ENABLE = no -RGBLIGHT_ENABLE = no +BACKLIGHT_ENABLE = yes +RGBLIGHT_ENABLE = yes diff --git a/keyboards/melody96/keymaps/konstantin/keymap.c b/keyboards/melody96/keymaps/konstantin/keymap.c index 1150e5dc79..7d65a0e98e 100644 --- a/keyboards/melody96/keymaps/konstantin/keymap.c +++ b/keyboards/melody96/keymaps/konstantin/keymap.c @@ -2,77 +2,77 @@ #include "konstantin.h" static const hsv_t *colors[] = { &GODSPEED_BLUE, &GODSPEED_YELLOW }; -static size_t cnum = sizeof colors / sizeof *colors; +static const size_t cnum = sizeof colors / sizeof *colors; static size_t cidx = 0; -void eeconfig_init_keymap(void) { - rgblight_sethsv(colors[cidx]->h, colors[cidx]->s, colors[cidx]->v); -} - enum keycodes_keymap { - RGB_SET = RANGE_KEYMAP, + RGB_SET = RANGE_KEYMAP, }; +void eeconfig_init_keymap(void) { + rgblight_sethsv(colors[cidx]->h, colors[cidx]->s, colors[cidx]->v); +} + bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case RGB_SET: - if (record->event.pressed) { - cidx = (cidx + 1) % cnum; - rgblight_sethsv(colors[cidx]->h, colors[cidx]->s, colors[cidx]->v); - } - return false; + switch (keycode) { + case RGB_SET: + if (record->event.pressed) { + cidx = (cidx + 1) % cnum; + rgblight_sethsv(colors[cidx]->h, colors[cidx]->s, colors[cidx]->v); + } + return false; - default: - return true; - } + default: + return true; + } } const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Base layer - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ - * │Esc│F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│PSc│Ins│Hom│End│PgU│PgD│ - * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ - * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ \ │Del│NLk│P/ │P* │P- │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┼───┼───┼───┤ - * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │Bspc │P7 │P8 │P9 │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┼───┼───┤P+ │ - * │FnCaps│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ Enter │P4 │P5 │P6 │ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┼───┼───┼───┤ - * │LSft│RAG│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │RShift│ ↑ │P1 │P2 │P3 │ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┴┬──┴──┬───┼───┼───┼───┼───┤PEn│ - * │LCtl│LGui│LAlt│ Space │RAlGu│RCtrl│ ← │ ↓ │ → │P0 │P. │ │ - * └────┴────┴────┴────────────────────────┴─────┴─────┴───┴───┴───┴───┴───┴───┘ - */ - [L_BASE] = LAYOUT( \ - KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_INS, KC_HOME, KC_END, KC_PGUP, KC_PGDN, - KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_DEL, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_P7, KC_P8, KC_P9, XXXXXXX, - FN_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, - KC_LSFT, RAL_RGU, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, XXXXXXX, - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, RAL_RGU, XXXXXXX, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT - ), + /* Base layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │Esc│F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│PSc│Ins│Hom│End│PgU│PgD│ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │ ` │ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ \ │Del│NLk│P/ │P* │P- │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┼───┼───┼───┤ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │Bspc │P7 │P8 │P9 │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┼───┼───┤P+ │ + * │FnCaps│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ Enter │P4 │P5 │P6 │ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┼───┼───┼───┤ + * │LSft│RAG│ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │RShift│ ↑ │P1 │P2 │P3 │ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴──┬┴──┬┴──┬───┼───┼───┼───┼───┤PEn│ + * │LCtl│LGui│LAlt│ Space │RAG│FnL│RCt│ ← │ ↓ │ → │P0 │P. │ │ + * └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┴───┴───┴───┴───┘ + */ + [L_BASE] = LAYOUT( + KC_ESC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, KC_INS, KC_HOME, KC_END, KC_PGUP, KC_PGDN, + KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_DEL, KC_NLCK, KC_PSLS, KC_PAST, KC_PMNS, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_P7, KC_P8, KC_P9, XXXXXXX, + FN_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_P4, KC_P5, KC_P6, KC_PPLS, + KC_LSFT, RAL_RGU, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, KC_UP, KC_P1, KC_P2, KC_P3, XXXXXXX, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, RAL_RGU, FN_FNLK, KC_RCTL, KC_LEFT, KC_DOWN, KC_RGHT, KC_P0, KC_PDOT, KC_PENT + ), - /* Function layer - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │Sys│SLk│Pau│Brk│Top│Btm│ - * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ - * │ │ │ │ │ │ │ │ │ │ │ │ │ │ │ │RTg│ ÷ │ × │ − │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┼───┼───┼───┤ - * │ M4 │M2 │M↑ │M1 │M3 │M5 │ │UCM│ │Stp│Ply│Prv│Nxt│Clear│RH+│RS+│RV+│ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┼───┼───┤RSt│ - * │ │M← │M↓ │M→ │MW↑│ │ │ │ │ │ │ │ │RH-│RS-│RV-│ │ - * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┼───┼───┼───┤ - * │ │ │MA0│MA2│MW←│MW→│ │ │ │Vo-│Vo+│Mut│ │PgU│RMR│RMS│RMB│ │ - * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┴┬──┴──┬───┼───┼───┼───┼───┤RMP│ - * │ │DtPR│DtNA│ MW↓ │ │ App │Hom│PgD│End│RM-│RM+│ │ - * └────┴────┴────┴────────────────────────┴─────┴─────┴───┴───┴───┴───┴───┴───┘ - */ - [L_FN] = LAYOUT( \ - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_SYSR, KC_SLCK, KC_PAUS, KC_BRK, TOP, BOTTOM, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RGB_TOG, DIVIDE, TIMES, MINUS, - KC_BTN4, KC_BTN2, KC_MS_U, KC_BTN1, KC_BTN3, KC_BTN5, _______, UC_MOD, _______, KC_MSTP, KC_MPLY, KC_MPRV, KC_MNXT, CLEAR, RGB_HUI, RGB_SAI, RGB_VAI, XXXXXXX, - _______, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_U, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SET, - _______, _______, KC_ACL0, KC_ACL2, KC_WH_L, KC_WH_R, _______, _______, _______, KC_VOLD, KC_VOLU, KC_MUTE, _______, KC_PGUP, RGB_M_R, RGB_M_SN,RGB_M_B, XXXXXXX, - _______, DST_P_R, DST_N_A, KC_WH_D, _______, XXXXXXX, KC_APP, KC_HOME, KC_PGDN, KC_END, RGB_RMOD,RGB_MOD, RGB_M_P - ), + /* Function layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │ │ │ │ │ │ │ │ │ │ │ │ │ │Sys│SLk│Pau│Brk│Top│Btm│ + * ├───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┼───┤ + * │ │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│ │ │RTg│ ÷ │ × │ − │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┼───┼───┼───┤ + * │ M4 │M2 │M↑ │M1 │M3 │M5 │ │UCM│ │Stp│Ply│Prv│Nxt│Clear│RH+│RS+│RV+│ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┼───┼───┤RSt│ + * │ │M← │M↓ │M→ │MW↑│ │ │ │ │ │ │ │ │RH-│RS-│RV-│ │ + * ├────┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┼───┼───┼───┤ + * │ │ │MA0│MA2│MW←│MW→│ │ │ │Vo-│Vo+│Mut│ │PgU│RMR│RMS│RMB│ │ + * ├────┼───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴──┬┴──┬┴──┬───┼───┼───┼───┼───┤RMP│ + * │ │DtPR│DtNA│ MW↓ │ │ │App│Hom│PgD│End│RM-│RM+│ │ + * └────┴────┴────┴────────────────────────┴───┴───┴───┴───┴───┴───┴───┴───┴───┘ + */ + [L_FN] = LAYOUT( + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_SYSR, KC_SLCK, KC_PAUS, KC_BRK, TOP, BOTTOM, + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, RGB_TOG, DIVIDE, TIMES, MINUS, + KC_BTN4, KC_BTN2, KC_MS_U, KC_BTN1, KC_BTN3, KC_BTN5, _______, UC_MOD, _______, KC_MSTP, KC_MPLY, KC_MPRV, KC_MNXT, CLEAR, RGB_HUI, RGB_SAI, RGB_VAI, XXXXXXX, + _______, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_U, _______, _______, _______, _______, _______, _______, _______, _______, RGB_HUD, RGB_SAD, RGB_VAD, RGB_SET, + _______, _______, KC_ACL0, KC_ACL2, KC_WH_L, KC_WH_R, _______, _______, _______, KC_VOLD, KC_VOLU, KC_MUTE, _______, KC_PGUP, RGB_M_R, RGB_M_SN,RGB_M_B, XXXXXXX, + _______, DST_P_R, DST_N_A, KC_WH_D, _______, _______, KC_APP, KC_HOME, KC_PGDN, KC_END, RGB_RMOD,RGB_MOD, RGB_M_P + ), }; diff --git a/keyboards/whitefox/keymaps/konstantin/keymap.c b/keyboards/whitefox/keymaps/konstantin/keymap.c index dddfb274e7..c8c8c790c7 100644 --- a/keyboards/whitefox/keymaps/konstantin/keymap.c +++ b/keyboards/whitefox/keymaps/konstantin/keymap.c @@ -2,66 +2,66 @@ #include "konstantin.h" const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - /* Base layer - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ - * │Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ \ │ ` │PSc│ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┤ - * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │Bspc │Del│ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ - * │FnCaps│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ Enter │PgU│ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ - * │ LShift │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │RCtRSf│ ↑ │PgD│ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤ - * │LCtl│LGui│LAlt│ Space │RAlG│FnLk│ │ ← │ ↓ │ → │ - * └────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘ - */ - [L_BASE] = LAYOUT_truefox( \ - KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, KC_PSCR, \ - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_DEL, \ - FN_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, \ - KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, RCT_RSF, KC_UP, KC_PGDN, \ - KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, RAL_RGU, FN_FNLK, KC_LEFT, KC_DOWN, KC_RGHT \ - ), + /* Base layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │Esc│ 1 │ 2 │ 3 │ 4 │ 5 │ 6 │ 7 │ 8 │ 9 │ 0 │ - │ = │ \ │ ` │PSc│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┤ + * │ Tab │ Q │ W │ E │ R │ T │ Y │ U │ I │ O │ P │ [ │ ] │Bspc │Del│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ + * │FnCaps│ A │ S │ D │ F │ G │ H │ J │ K │ L │ ; │ ' │ Enter │PgU│ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ + * │ LShift │ Z │ X │ C │ V │ B │ N │ M │ , │ . │ / │RCtRSf│ ↑ │PgD│ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤ + * │LCtl│LGui│LAlt│ Space │RAlG│FnLk│ │ ← │ ↓ │ → │ + * └────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘ + */ + [L_BASE] = LAYOUT_truefox( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_BSLS, KC_GRV, KC_PSCR, + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, KC_RBRC, KC_BSPC, KC_DEL, + FN_CAPS, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, KC_ENT, KC_PGUP, + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, RCT_RSF, KC_UP, KC_PGDN, + KC_LCTL, KC_LGUI, KC_LALT, KC_SPC, RAL_RGU, FN_FNLK, KC_LEFT, KC_DOWN, KC_RGHT + ), - /* Function layer - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ - * │ │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│Num│SLk│Pau│ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┤ - * │ M4 │M2 │M↑ │M1 │M3 │M5 │ │UCM│ │Stp│Ply│Prv│Nxt│Clear│Ins│ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ - * │ │M← │M↓ │M→ │MW↑│ │ │ │ │ │ │ │ │Top│ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ - * │ │MA0│MA2│MW←│MW→│ │ │ │Vo-│Vo+│Mut│ App │PgU│Btm│ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤ - * │ │DtPR│DtNA│ MW↓ │ │ │ │Hom│PgD│End│ - * └────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘ - */ - [L_FN] = LAYOUT_truefox( \ - _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, NUMPAD, KC_SLCK, KC_PAUS, \ - KC_BTN4, KC_BTN2, KC_MS_U, KC_BTN1, KC_BTN3, KC_BTN5, _______, UC_MOD, _______, KC_MSTP, KC_MPLY, KC_MPRV, KC_MNXT, CLEAR, KC_INS, \ - _______, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_U, _______, _______, _______, _______, _______, _______, _______, _______, TOP, \ - _______, KC_ACL0, KC_ACL2, KC_WH_L, KC_WH_R, _______, _______, _______, KC_VOLD, KC_VOLU, KC_MUTE, KC_APP, KC_PGUP, BOTTOM, \ - _______, DST_P_R, DST_N_A, KC_WH_D, _______, _______, KC_HOME, KC_PGDN, KC_END \ - ), + /* Function layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │ │F1 │F2 │F3 │F4 │F5 │F6 │F7 │F8 │F9 │F10│F11│F12│Num│SLk│Pau│ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┤ + * │ M4 │M2 │M↑ │M1 │M3 │M5 │ │UCM│ │Stp│Ply│Prv│Nxt│Clear│Ins│ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ + * │ │M← │M↓ │M→ │MW↑│ │ │ │ │ │ │ │ │Top│ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ + * │ │MA0│MA2│MW←│MW→│ │ │ │Vo-│Vo+│Mut│ App │PgU│Btm│ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤ + * │ │DtPR│DtNA│ MW↓ │ │ │ │Hom│PgD│End│ + * └────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘ + */ + [L_FN] = LAYOUT_truefox( + _______, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, NUMPAD, KC_SLCK, KC_PAUS, + KC_BTN4, KC_BTN2, KC_MS_U, KC_BTN1, KC_BTN3, KC_BTN5, _______, UC_MOD, _______, KC_MSTP, KC_MPLY, KC_MPRV, KC_MNXT, CLEAR, KC_INS, + _______, KC_MS_L, KC_MS_D, KC_MS_R, KC_WH_U, _______, _______, _______, _______, _______, _______, _______, _______, TOP, + _______, KC_ACL0, KC_ACL2, KC_WH_L, KC_WH_R, _______, _______, _______, KC_VOLD, KC_VOLU, KC_MUTE, KC_APP, KC_PGUP, BOTTOM, + _______, DST_P_R, DST_N_A, KC_WH_D, _______, _______, KC_HOME, KC_PGDN, KC_END + ), - /* Numpad layer - * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ - * │ │ │ │ │ │ │ │P7 │P8 │P9 │P- │ − │ = │Num│ │ │ - * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┤ - * │ │ │ │ │ │ │ │P4 │P5 │P6 │P+ │ ( │ ) │ │ │ - * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ - * │ │ │ │ │ │ │ │P1 │P2 │P3 │P* │ × │ PEnter │ │ - * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ - * │ │ │ │ │ │ │P0 │P0 │ , │P. │P/ │ ÷ │ │ │ - * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤ - * │ │ │ │ │ │ │ │ │ │ │ - * └────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘ - */ - [L_NUMPAD] = LAYOUT_truefox( \ - _______, _______, _______, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, KC_PMNS, MINUS, EQUALS, NUMPAD, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, KC_P4, KC_P5, KC_P6, KC_PPLS, L_PAREN, R_PAREN, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, KC_P1, KC_P2, KC_P3, KC_PAST, TIMES, KC_PENT, _______, \ - _______, _______, _______, _______, _______, _______, KC_P0, KC_P0, COMMA, KC_PDOT, KC_PSLS, DIVIDE, _______, _______, \ - _______, _______, _______, _______, _______, _______, _______, _______, _______ \ - ), + /* Numpad layer + * ┌───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┬───┐ + * │ │ │ │ │ │ │ │P7 │P8 │P9 │P- │ − │ = │Num│ │ │ + * ├───┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴───┼───┤ + * │ │ │ │ │ │ │ │P4 │P5 │P6 │P+ │ ( │ ) │ │ │ + * ├─────┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴┬──┴─────┼───┤ + * │ │ │ │ │ │ │ │P1 │P2 │P3 │P* │ × │ PEnter │ │ + * ├──────┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴─┬─┴────┬───┼───┤ + * │ │ │ │ │ │ │P0 │P0 │ , │P. │P/ │ ÷ │ │ │ + * ├────┬───┴┬──┴─┬─┴───┴───┴───┴───┴───┴──┬┴───┼───┴┬─┬───┼───┼───┤ + * │ │ │ │ │ │ │ │ │ │ │ + * └────┴────┴────┴────────────────────────┴────┴────┘ └───┴───┴───┘ + */ + [L_NUMPAD] = LAYOUT_truefox( + _______, _______, _______, _______, _______, _______, _______, KC_P7, KC_P8, KC_P9, KC_PMNS, MINUS, EQUALS, NUMPAD, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_P4, KC_P5, KC_P6, KC_PPLS, L_PAREN, R_PAREN, _______, _______, + _______, _______, _______, _______, _______, _______, _______, KC_P1, KC_P2, KC_P3, KC_PAST, TIMES, KC_PENT, _______, + _______, _______, _______, _______, _______, _______, KC_P0, KC_P0, COMMA, KC_PDOT, KC_PSLS, DIVIDE, _______, _______, + _______, _______, _______, _______, _______, _______, _______, _______, _______ + ), }; diff --git a/users/konstantin/konstantin.c b/users/konstantin/konstantin.c index 753742fa78..9e3caca414 100644 --- a/users/konstantin/konstantin.c +++ b/users/konstantin/konstantin.c @@ -4,107 +4,99 @@ __attribute__((weak)) void keyboard_pre_init_keymap(void) {} void keyboard_pre_init_user(void) { - keyboard_pre_init_keymap(); + keyboard_pre_init_keymap(); } __attribute__((weak)) void eeconfig_init_keymap(void) {} void eeconfig_init_user(void) { - eeconfig_init_keymap(); + eeconfig_init_keymap(); } __attribute__((weak)) void keyboard_post_init_keymap(void) {} void keyboard_post_init_user(void) { - keyboard_post_init_keymap(); + keyboard_post_init_keymap(); } __attribute__((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - return true; + return true; } bool process_record_user(uint16_t keycode, keyrecord_t *record) { - if (!process_record_keymap(keycode, record)) { - return false; - } - -#ifdef LAYER_NUMPAD - void toggle_numpad(void) { - layer_invert(L_NUMPAD); - bool numpad = IS_LAYER_ON(L_NUMPAD), num_lock = IS_HOST_LED_ON(USB_LED_NUM_LOCK); - if (num_lock != numpad) { - tap_code(KC_NLCK); // Toggle Num Lock to match layer state + if (!process_record_keymap(keycode, record)) { + return false; } - } -#endif - switch (keycode) { - case CLEAR: - if (record->event.pressed) { - SEND_STRING(SS_LCTRL("a") SS_TAP(X_DELETE)); - } - return false; + switch (keycode) { + case CLEAR: + if (record->event.pressed) { + SEND_STRING(SS_LCTRL("a") SS_TAP(X_DELETE)); + } + return false; - case DST_P_R: - (record->event.pressed ? register_code16 : unregister_code16)( - (get_mods() & DST_MOD_MASK) ? DST_REM : DST_PRV - ); - return false; + case DST_P_R: + (record->event.pressed ? register_code16 : unregister_code16)( + (get_mods() & DST_MOD_MASK) ? DST_REM : DST_PRV + ); + return false; - case DST_N_A: - (record->event.pressed ? register_code16 : unregister_code16)( - (get_mods() & DST_MOD_MASK) ? DST_ADD : DST_NXT - ); - return false; + case DST_N_A: + (record->event.pressed ? register_code16 : unregister_code16)( + (get_mods() & DST_MOD_MASK) ? DST_ADD : DST_NXT + ); + return false; #ifdef LAYER_FN - static bool fn_lock; - - case FN_FNLK: - if (record->event.pressed && record->tap.count == TAPPING_TOGGLE) { - fn_lock = !IS_LAYER_ON(L_FN); // Fn layer will be toggled after this - } - return true; -#endif + static bool fn_lock; -#ifdef LAYER_NUMPAD - case NUMPAD: - if (record->event.pressed) { - toggle_numpad(); - } - return false; + case FN_FNLK: + if (record->event.pressed && record->tap.count == TAPPING_TOGGLE) { + fn_lock = !IS_LAYER_ON(L_FN); // Fn layer will be toggled after this + } + return true; #endif - case KC_ESC: - if (record->event.pressed) { -#ifdef LAYER_NUMPAD - if (IS_LAYER_ON(L_NUMPAD)) { - toggle_numpad(); - return false; - } + case KC_ESC: + if (record->event.pressed) { +#ifdef LAYER_NUMPAD // Disable Numpad layer before Fn layer + if (IS_LAYER_ON(L_NUMPAD)) { + layer_off(L_NUMPAD); + return false; + } #endif #ifdef LAYER_FN - if (IS_LAYER_ON(L_FN) && fn_lock) { - layer_off(L_FN); - return fn_lock = false; - } + if (IS_LAYER_ON(L_FN) && fn_lock) { + layer_off(L_FN); + return fn_lock = false; + } #endif - } - return true; + } + return true; - default: - return true; - } + default: + return true; + } } __attribute__((weak)) uint32_t layer_state_set_keymap(uint32_t state) { - return state; + return state; } uint32_t layer_state_set_user(uint32_t state) { - return layer_state_set_keymap(state); + state = layer_state_set_keymap(state); + +#ifdef LAYER_NUMPAD + bool numpad = state & 1UL<<L_NUMPAD; + bool num_lock = IS_HOST_LED_ON(USB_LED_NUM_LOCK); + if (numpad != num_lock) { + tap_code(KC_NLCK); // Toggle Num Lock to match Numpad layer state + } +#endif + + return state; } diff --git a/users/konstantin/konstantin.h b/users/konstantin/konstantin.h index 0639b93a6d..d43712b965 100644 --- a/users/konstantin/konstantin.h +++ b/users/konstantin/konstantin.h @@ -1,20 +1,25 @@ #pragma once #include "quantum.h" -#if defined(RGBLIGHT_ENABLE) || defined(RGBMATRIX_ENABLE) - #include "rgb.h" +#if defined(RGBLIGHT_ENABLE) || defined(RGB_MATRIX_ENABLE) + #include "rgb.h" #endif #ifdef TAP_DANCE_ENABLE - #include "tap_dance.h" + #include "tap_dance.h" #endif #if defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) - #include "unicode.h" + #include "unicode.h" #endif #ifdef LAYER_FN - #define FN MO(L_FN) - #define FN_CAPS LT(L_FN, KC_CAPS) - #define FN_FNLK TT(L_FN) + #define FN MO(L_FN) + #define FN_CAPS LT(L_FN, KC_CAPS) + #define FN_ESC LT(L_FN, KC_ESC) + #define FN_FNLK TT(L_FN) +#endif + +#ifdef LAYER_NUMPAD + #define NUMPAD TG(L_NUMPAD) #endif #define KC_SYSR LALT(KC_PSCR) @@ -27,50 +32,49 @@ #define MV_RGHT LCTL(KC_RGHT) #define TOP LCTL(KC_HOME) #define BOTTOM LCTL(KC_END) -#define PRV_TAB LCTL(KC_PGUP) -#define NXT_TAB LCTL(KC_PGDN) +#define TAB_PRV LCTL(KC_PGUP) +#define TAB_NXT LCTL(KC_PGDN) +#define DEL_PRV LCTL(KC_BSPC) +#define DEL_NXT LCTL(KC_DEL) #define DST_ADD LCTL(LGUI(KC_D)) #define DST_REM LCTL(LGUI(KC_F4)) #define DST_PRV LCTL(LGUI(KC_LEFT)) #define DST_NXT LCTL(LGUI(KC_RGHT)) #ifndef DST_MOD_MASK - #define DST_MOD_MASK MOD_MASK_CTRL + #define DST_MOD_MASK MOD_MASK_SHIFT #endif #define LCT_CPS LCTL_T(KC_CAPS) #ifdef SEND_STRING_CLEAN - #undef SEND_STRING - #define SEND_STRING(string) { \ - uint8_t ss_mods = get_mods(); \ - clear_mods(); \ - send_string_P(PSTR(string)); \ - set_mods(ss_mods); \ - } + #undef SEND_STRING + #define SEND_STRING(string) { \ + uint8_t ss_mods = get_mods(); \ + clear_mods(); \ + send_string_P(PSTR(string)); \ + set_mods(ss_mods); \ + } #endif enum keycodes_user { - CLEAR = SAFE_RANGE, - DST_P_R, - DST_N_A, -#ifdef LAYER_NUMPAD - NUMPAD, -#endif + CLEAR = SAFE_RANGE, + DST_P_R, + DST_N_A, - RANGE_KEYMAP, + RANGE_KEYMAP, }; enum layers_user { - L_BASE, + L_BASE, #ifdef LAYER_FN - L_FN, + L_FN, #endif #ifdef LAYER_NUMPAD - L_NUMPAD, + L_NUMPAD, #endif - L_RANGE_KEYMAP, + L_RANGE_KEYMAP, }; void keyboard_pre_init_keymap(void); diff --git a/users/konstantin/rgb.h b/users/konstantin/rgb.h index 53b5821b0e..aed855aa05 100644 --- a/users/konstantin/rgb.h +++ b/users/konstantin/rgb.h @@ -3,15 +3,15 @@ #include "quantum.h" typedef struct { - uint16_t h; // 0–360 - uint8_t s; // 0–255 - uint8_t v; // 0–255 + uint16_t h; // 0–360 + uint8_t s; // 0–255 + uint8_t v; // 0–255 } hsv_t; typedef struct { - uint8_t r; // 0–255 - uint8_t g; // 0–255 - uint8_t b; // 0–255 + uint8_t r; // 0–255 + uint8_t g; // 0–255 + uint8_t b; // 0–255 } rgb_t; extern const hsv_t GODSPEED_BLUE; diff --git a/users/konstantin/rules.mk b/users/konstantin/rules.mk index 6bda030fb0..1799d2be50 100644 --- a/users/konstantin/rules.mk +++ b/users/konstantin/rules.mk @@ -1,12 +1,15 @@ SRC += konstantin.c -ifneq (,$(filter yes,$(RGBLIGHT_ENABLE) $(RGB_MATRIX_ENABLE))) # if either is yes - SRC += rgb.c +ifeq ($(strip $(RGBLIGHT_ENABLE)), yes) + SRC += rgb.c +endif +ifneq ($(strip $(RGB_MATRIX_ENABLE)), no) + SRC += rgb.c endif ifeq ($(strip $(TAP_DANCE_ENABLE)), yes) - SRC += tap_dance.c + SRC += tap_dance.c endif -ifneq (,$(filter yes,$(UNICODE_ENABLE) $(UNICODEMAP_ENABLE))) # if either is yes - SRC += unicode.c +ifneq (,$(filter yes,$(UNICODE_ENABLE) $(UNICODEMAP_ENABLE))) + SRC += unicode.c endif EXTRAFLAGS += -flto diff --git a/users/konstantin/tap_dance.c b/users/konstantin/tap_dance.c index 0b405939b3..fa43288ce7 100644 --- a/users/konstantin/tap_dance.c +++ b/users/konstantin/tap_dance.c @@ -1,117 +1,117 @@ #include "tap_dance.h" #include "konstantin.h" -#define ACTION_TAP_DANCE_DOUBLE_MOD(mod1, mod2) { \ - .fn = { td_double_mod_each, NULL, td_double_mod_reset }, \ - .user_data = &(qk_tap_dance_pair_t){ mod1, mod2 }, \ - } +#define ACTION_TAP_DANCE_DOUBLE_MOD(mod1, mod2) { \ + .fn = { td_double_mod_each, NULL, td_double_mod_reset }, \ + .user_data = &(qk_tap_dance_pair_t){ mod1, mod2 }, \ + } void td_double_mod_each(qk_tap_dance_state_t *state, void *user_data) { - qk_tap_dance_pair_t *data = (qk_tap_dance_pair_t *)user_data; - - // Single tap → mod1, double tap → mod2, triple tap etc. → mod1+mod2 - if (state->count == 1 || state->count == 3) { - register_code(data->kc1); - } else if (state->count == 2) { - unregister_code(data->kc1); - register_code(data->kc2); - } - // Prevent tap dance from sending the mods as weak mods - state->weak_mods &= ~(MOD_BIT(data->kc1) | MOD_BIT(data->kc2)); + qk_tap_dance_pair_t *data = (qk_tap_dance_pair_t *)user_data; + + // Single tap → mod1, double tap → mod2, triple tap etc. → mod1+mod2 + if (state->count == 1 || state->count == 3) { + register_code(data->kc1); + } else if (state->count == 2) { + unregister_code(data->kc1); + register_code(data->kc2); + } + // Prevent tap dance from sending the mods as weak mods + state->weak_mods &= ~(MOD_BIT(data->kc1) | MOD_BIT(data->kc2)); } void td_double_mod_reset(qk_tap_dance_state_t *state, void *user_data) { - qk_tap_dance_pair_t *data = (qk_tap_dance_pair_t *)user_data; - - if (state->count == 1 || state->count >= 3) { - unregister_code(data->kc1); - } - if (state->count >= 2) { - unregister_code(data->kc2); - } + qk_tap_dance_pair_t *data = (qk_tap_dance_pair_t *)user_data; + + if (state->count == 1 || state->count >= 3) { + unregister_code(data->kc1); + } + if (state->count >= 2) { + unregister_code(data->kc2); + } } -#define ACTION_TAP_DANCE_MOD_LAYER(mod, layer) { \ - .fn = { td_mod_layer_each, NULL, td_mod_layer_reset }, \ - .user_data = &(qk_tap_dance_dual_role_t){ mod, layer }, \ - } +#define ACTION_TAP_DANCE_MOD_LAYER(mod, layer) { \ + .fn = { td_mod_layer_each, NULL, td_mod_layer_reset }, \ + .user_data = &(qk_tap_dance_dual_role_t){ mod, layer }, \ + } void td_mod_layer_each(qk_tap_dance_state_t *state, void *user_data) { - qk_tap_dance_dual_role_t *data = (qk_tap_dance_dual_role_t *)user_data; - - // Single tap → mod, double tap → layer, triple tap etc. → mod+layer - if (state->count == 1 || state->count == 3) { - register_code(data->kc); - } else if (state->count == 2) { - unregister_code(data->kc); - // Prevent tap dance from sending the mod as a weak mod - state->weak_mods &= ~MOD_BIT(data->kc); - layer_on(data->layer); - } + qk_tap_dance_dual_role_t *data = (qk_tap_dance_dual_role_t *)user_data; + + // Single tap → mod, double tap → layer, triple tap etc. → mod+layer + if (state->count == 1 || state->count == 3) { + register_code(data->kc); + } else if (state->count == 2) { + unregister_code(data->kc); + // Prevent tap dance from sending the mod as a weak mod + state->weak_mods &= ~MOD_BIT(data->kc); + layer_on(data->layer); + } } void td_mod_layer_reset(qk_tap_dance_state_t *state, void *user_data) { - qk_tap_dance_dual_role_t *data = (qk_tap_dance_dual_role_t *)user_data; - - if (state->count == 1 || state->count >= 3) { - unregister_code(data->kc); - } - if (state->count >= 2) { - layer_off(data->layer); - } + qk_tap_dance_dual_role_t *data = (qk_tap_dance_dual_role_t *)user_data; + + if (state->count == 1 || state->count >= 3) { + unregister_code(data->kc); + } + if (state->count >= 2) { + layer_off(data->layer); + } } -#define ACTION_TAP_DANCE_LAYER_MOD(layer, mod) { \ - .fn = { td_layer_mod_each, NULL, td_layer_mod_reset }, \ - .user_data = &(qk_tap_dance_layer_mod_t){ layer, mod, 0, 0 }, \ - } +#define ACTION_TAP_DANCE_LAYER_MOD(layer, mod) { \ + .fn = { td_layer_mod_each, NULL, td_layer_mod_reset }, \ + .user_data = &(qk_tap_dance_layer_mod_t){ layer, mod, 0, 0 }, \ + } typedef struct { - uint8_t layer; - uint16_t kc; - bool layer_on; // Layer state when tap dance started - bool started; + uint8_t layer; + uint16_t kc; + bool layer_on; // Layer state when tap dance started + bool started; } qk_tap_dance_layer_mod_t; void td_layer_mod_each(qk_tap_dance_state_t *state, void *user_data) { - qk_tap_dance_layer_mod_t *data = (qk_tap_dance_layer_mod_t *)user_data; - if (!data->started) { - data->layer_on = IS_LAYER_ON(data->layer); - data->started = true; - } - - // Single tap → layer, double tap → mod, triple tap etc. → layer+mod - if (state->count == 1 || state->count == 3) { - layer_on(data->layer); - } else if (state->count == 2) { - if (!data->layer_on) { - layer_off(data->layer); + qk_tap_dance_layer_mod_t *data = (qk_tap_dance_layer_mod_t *)user_data; + if (!data->started) { + data->layer_on = IS_LAYER_ON(data->layer); + data->started = true; + } + + // Single tap → layer, double tap → mod, triple tap etc. → layer+mod + if (state->count == 1 || state->count == 3) { + layer_on(data->layer); + } else if (state->count == 2) { + if (!data->layer_on) { + layer_off(data->layer); + } + register_code(data->kc); } - register_code(data->kc); - } } void td_layer_mod_reset(qk_tap_dance_state_t *state, void *user_data) { - qk_tap_dance_layer_mod_t *data = (qk_tap_dance_layer_mod_t *)user_data; + qk_tap_dance_layer_mod_t *data = (qk_tap_dance_layer_mod_t *)user_data; - if ((state->count == 1 || state->count >= 3) && !data->layer_on) { - layer_off(data->layer); - } - if (state->count >= 2) { - unregister_code(data->kc); - } + if ((state->count == 1 || state->count >= 3) && !data->layer_on) { + layer_off(data->layer); + } + if (state->count >= 2) { + unregister_code(data->kc); + } - data->started = false; + data->started = false; } qk_tap_dance_action_t tap_dance_actions[] = { - [TD_DST_A_R] = ACTION_TAP_DANCE_DOUBLE(DST_ADD, DST_REM), + [TD_DST_A_R] = ACTION_TAP_DANCE_DOUBLE(DST_ADD, DST_REM), - [TD_RAL_LAL] = ACTION_TAP_DANCE_DOUBLE_MOD(KC_RALT, KC_LALT), - [TD_RAL_RGU] = ACTION_TAP_DANCE_DOUBLE_MOD(KC_RALT, KC_RGUI), - [TD_RCT_RSF] = ACTION_TAP_DANCE_DOUBLE_MOD(KC_RCTL, KC_RSFT), + [TD_RAL_LAL] = ACTION_TAP_DANCE_DOUBLE_MOD(KC_RALT, KC_LALT), + [TD_RAL_RGU] = ACTION_TAP_DANCE_DOUBLE_MOD(KC_RALT, KC_RGUI), + [TD_RCT_RSF] = ACTION_TAP_DANCE_DOUBLE_MOD(KC_RCTL, KC_RSFT), - [TD_LSFT_FN] = ACTION_TAP_DANCE_MOD_LAYER(KC_LSFT, L_FN), - [TD_RCTL_FN] = ACTION_TAP_DANCE_MOD_LAYER(KC_RCTL, L_FN), - [TD_FN_RCTL] = ACTION_TAP_DANCE_LAYER_MOD(L_FN, KC_RCTL), + [TD_LSFT_FN] = ACTION_TAP_DANCE_MOD_LAYER(KC_LSFT, L_FN), + [TD_RCTL_FN] = ACTION_TAP_DANCE_MOD_LAYER(KC_RCTL, L_FN), + [TD_FN_RCTL] = ACTION_TAP_DANCE_LAYER_MOD(L_FN, KC_RCTL), }; diff --git a/users/konstantin/tap_dance.h b/users/konstantin/tap_dance.h index ad7c04cb7f..13d682a603 100644 --- a/users/konstantin/tap_dance.h +++ b/users/konstantin/tap_dance.h @@ -13,13 +13,13 @@ #define FN_RCTL TD(TD_FN_RCTL) enum tap_dance { - TD_DST_A_R, + TD_DST_A_R, - TD_RAL_LAL, - TD_RAL_RGU, - TD_RCT_RSF, + TD_RAL_LAL, + TD_RAL_RGU, + TD_RCT_RSF, - TD_LSFT_FN, - TD_RCTL_FN, - TD_FN_RCTL, + TD_LSFT_FN, + TD_RCTL_FN, + TD_FN_RCTL, }; diff --git a/users/konstantin/unicode.c b/users/konstantin/unicode.c index 144c0aaf75..8ef5aaa1ec 100644 --- a/users/konstantin/unicode.c +++ b/users/konstantin/unicode.c @@ -2,6 +2,6 @@ #ifdef UNICODEMAP_ENABLE const uint32_t PROGMEM unicode_map[] = { - FOREACH_UNICODE(UCM_ENTRY) + FOREACH_UNICODE(UCM_ENTRY) }; #endif diff --git a/users/konstantin/unicode.h b/users/konstantin/unicode.h index c8eddabb71..b2616d120b 100644 --- a/users/konstantin/unicode.h +++ b/users/konstantin/unicode.h @@ -3,13 +3,13 @@ #include "quantum.h" #define FOREACH_UNICODE(M) \ - M(COMMA, 0x002C) \ - M(L_PAREN, 0x0028) \ - M(R_PAREN, 0x0029) \ - M(EQUALS, 0x003D) \ - M(TIMES, 0x00D7) \ - M(DIVIDE, 0x00F7) \ - M(MINUS, 0x2212) + M(COMMA, 0x002C) \ + M(L_PAREN, 0x0028) \ + M(R_PAREN, 0x0029) \ + M(EQUALS, 0x003D) \ + M(TIMES, 0x00D7) \ + M(DIVIDE, 0x00F7) \ + M(MINUS, 0x2212) #define UC_KEYCODE(name, code) name = UC(code), @@ -19,16 +19,16 @@ #if defined(UNICODE_ENABLE) enum unicode_keycodes { - FOREACH_UNICODE(UC_KEYCODE) + FOREACH_UNICODE(UC_KEYCODE) }; #elif defined(UNICODEMAP_ENABLE) enum unicode_names { - FOREACH_UNICODE(UCM_NAME) + FOREACH_UNICODE(UCM_NAME) }; extern const uint32_t PROGMEM unicode_map[]; enum unicode_keycodes { - FOREACH_UNICODE(UCM_KEYCODE) + FOREACH_UNICODE(UCM_KEYCODE) }; #endif |