From 30843f8329315426ff433a40095f1de2b2669e57 Mon Sep 17 00:00:00 2001 From: Jacob Jerrell <86279411+jjerrell@users.noreply.github.com> Date: Thu, 12 Aug 2021 09:44:15 -0500 Subject: [PATCH] [Keymap] JJerrell - Add Userspace and ZSA Keyboard Keymaps (#13548) --- .../moonlander/keymaps/jjerrell/config.h | 27 ++ .../moonlander/keymaps/jjerrell/keymap.c | 117 +++++++ .../moonlander/keymaps/jjerrell/readme.md | 3 + .../moonlander/keymaps/jjerrell/rules.mk | 1 + layouts/community/ergodox/bocaj/config.h | 4 - layouts/community/ergodox/bocaj/keymap.c | 175 ---------- layouts/community/ergodox/bocaj/readme.md | 28 -- layouts/community/ergodox/bocaj/rules.mk | 14 - layouts/community/ergodox/jjerrell/config.h | 21 ++ layouts/community/ergodox/jjerrell/keymap.c | 129 +++++++ layouts/community/ergodox/jjerrell/readme.md | 5 + layouts/community/ergodox/jjerrell/rules.mk | 14 + layouts/community/ortho_4x12/bocaj/config.h | 106 ------ layouts/community/ortho_4x12/bocaj/keymap.c | 287 --------------- layouts/community/ortho_4x12/bocaj/readme.md | 23 -- layouts/community/ortho_4x12/bocaj/rules.mk | 43 --- .../community/ortho_4x12/jjerrell/config.h | 57 +++ .../community/ortho_4x12/jjerrell/keymap.c | 227 ++++++++++++ .../community/ortho_4x12/jjerrell/readme.md | 7 + .../community/ortho_4x12/jjerrell/rules.mk | 8 + users/bocaj/.gitignore | 1 - users/bocaj/.gitlab-ci.yml | 24 -- users/bocaj/bocaj.c | 210 ----------- users/bocaj/bocaj.h | 73 ---- users/bocaj/config.h | 113 ------ users/bocaj/process_records.c | 111 ------ users/bocaj/process_records.h | 44 --- users/bocaj/readme.md | 5 - users/bocaj/rgb_matrix_stuff.c | 106 ------ users/bocaj/rgb_matrix_stuff.h | 10 - users/bocaj/wrappers.h | 193 ---------- users/jjerrell/.gitignore | 1 + users/jjerrell/config.h | 26 ++ users/jjerrell/jjerrell.c | 138 ++++++++ users/jjerrell/jjerrell.h | 53 +++ users/jjerrell/process_records.c | 139 ++++++++ users/jjerrell/process_records.h | 41 +++ users/jjerrell/readme.md | 50 +++ users/{bocaj => jjerrell}/rules.mk | 11 +- users/jjerrell/wrappers.h | 329 ++++++++++++++++++ 40 files changed, 1399 insertions(+), 1575 deletions(-) create mode 100644 keyboards/moonlander/keymaps/jjerrell/config.h create mode 100644 keyboards/moonlander/keymaps/jjerrell/keymap.c create mode 100644 keyboards/moonlander/keymaps/jjerrell/readme.md create mode 100644 keyboards/moonlander/keymaps/jjerrell/rules.mk delete mode 100644 layouts/community/ergodox/bocaj/config.h delete mode 100644 layouts/community/ergodox/bocaj/keymap.c delete mode 100644 layouts/community/ergodox/bocaj/readme.md delete mode 100644 layouts/community/ergodox/bocaj/rules.mk create mode 100644 layouts/community/ergodox/jjerrell/config.h create mode 100644 layouts/community/ergodox/jjerrell/keymap.c create mode 100644 layouts/community/ergodox/jjerrell/readme.md create mode 100644 layouts/community/ergodox/jjerrell/rules.mk delete mode 100644 layouts/community/ortho_4x12/bocaj/config.h delete mode 100644 layouts/community/ortho_4x12/bocaj/keymap.c delete mode 100644 layouts/community/ortho_4x12/bocaj/readme.md delete mode 100644 layouts/community/ortho_4x12/bocaj/rules.mk create mode 100644 layouts/community/ortho_4x12/jjerrell/config.h create mode 100644 layouts/community/ortho_4x12/jjerrell/keymap.c create mode 100644 layouts/community/ortho_4x12/jjerrell/readme.md create mode 100644 layouts/community/ortho_4x12/jjerrell/rules.mk delete mode 100644 users/bocaj/.gitignore delete mode 100644 users/bocaj/.gitlab-ci.yml delete mode 100644 users/bocaj/bocaj.c delete mode 100644 users/bocaj/bocaj.h delete mode 100644 users/bocaj/config.h delete mode 100644 users/bocaj/process_records.c delete mode 100644 users/bocaj/process_records.h delete mode 100644 users/bocaj/readme.md delete mode 100644 users/bocaj/rgb_matrix_stuff.c delete mode 100644 users/bocaj/rgb_matrix_stuff.h delete mode 100644 users/bocaj/wrappers.h create mode 100644 users/jjerrell/.gitignore create mode 100644 users/jjerrell/config.h create mode 100644 users/jjerrell/jjerrell.c create mode 100644 users/jjerrell/jjerrell.h create mode 100644 users/jjerrell/process_records.c create mode 100644 users/jjerrell/process_records.h create mode 100644 users/jjerrell/readme.md rename users/{bocaj => jjerrell}/rules.mk (73%) create mode 100644 users/jjerrell/wrappers.h diff --git a/keyboards/moonlander/keymaps/jjerrell/config.h b/keyboards/moonlander/keymaps/jjerrell/config.h new file mode 100644 index 0000000000..1fd17fbbe3 --- /dev/null +++ b/keyboards/moonlander/keymaps/jjerrell/config.h @@ -0,0 +1,27 @@ +/* Copyright 2020 ZSA Technology Labs, Inc <@zsa> + * Copyright 2020 Jack Humbert + * Copyright 2020 Christopher Courtney (@drashna) + * Copyright 2021 Jacob Jerrell <@jjerrell> + * + * 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 . + */ + +#pragma once + +#define ORYX_CONFIGURATOR + +#undef PRODUCT +#define PRODUCT Moonlander Mark I - Modified by <@jjerrell> + +#define IGNORE_MOD_TAP_INTERRUPT diff --git a/keyboards/moonlander/keymaps/jjerrell/keymap.c b/keyboards/moonlander/keymaps/jjerrell/keymap.c new file mode 100644 index 0000000000..012b773678 --- /dev/null +++ b/keyboards/moonlander/keymaps/jjerrell/keymap.c @@ -0,0 +1,117 @@ +/** + * Copyright (C) 2021 Jerrell, Jacob <@jjerrell> + * + * This file is part of qmk_firmware. + * + * qmk_firmware 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 3 of the License, or + * (at your option) any later version. + * + * qmk_firmware 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 qmk_firmware. If not, see . + */ + +#include "jjerrell.h" + +enum moonlander_layers { + _GAME_LOWER = LAYER_SAFE_RANGE, + // _GAME_RAISE, +}; + +// clang-format off +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_WORKMAN] = LAYOUT_moonlander_mods( + __________________WORKMN_L1__________________, __________________WORKMN_R1__________________, + __________________WORKMN_L2__________________, __________________WORKMN_R2__________________, + __________________WORKMN_L3__________________, __________________WORKMN_R3__________________, + XXXXXXX, XXXXXXX, XXXXXXX, KC_LSFT, KC_RSFT, XXXXXXX, XXXXXXX, XXXXXXX + ), + + [_LOWER] = LAYOUT_moonlander_mods( + __________________LOWER_L1___________________, __________________LOWER_R1___________________, + __________________LOWER_L2___________________, __________________LOWER_R2___________________, + __________________LOWER_L3___________________, __________________LOWER_R3___________________, + XXXXXXX, XXXXXXX, XXXXXXX, KC_LSFT, KC_0, KC_DOT, KC_COMM, KC_PLUS + ), + + [_RAISE] = LAYOUT_moonlander_common( + __________________RAISE_L1___________________, __________________RAISE_R1___________________, + __________________RAISE_L2___________________, __________________RAISE_R2___________________, + __________________RAISE_L3___________________, __________________RAISE_R3___________________, + XXXXXXX, XXXXXXX, XXXXXXX, KC_LSFT, KC_RSFT, XXXXXXX, XXXXXXX, XXXXXXX + ), + + [_ADJUST] = LAYOUT_moonlander_common( + __________________ADJUST_L1__________________, __________________ADJUST_R1__________________, + __________________ADJUST_L2__________________, __________________ADJUST_R2__________________, + __________________ADJUST_L3__________________, __________________ADJUST_R3__________________, + XXXXXXX, XXXXXXX, XXXXXXX, KC_LSFT, KC_RSFT, XXXXXXX, XXXXXXX, XXXXXXX + ), + + [_SPECIAL] = LAYOUT_moonlander_common( + XXXXXXX, XXXXXXX, KC_WH_D, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, KC_WH_L, KC_WH_U, KC_WH_R, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, KC_LALT, KC_RALT, XXXXXXX, XXXXXXX, XXXXXXX + ), + + [_GAME] = LAYOUT_moonlander_gamepad( + KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, + KC_TAB, __________________QWERTY_L1__________________, KC_SLSH, + KC_LALT, __________________QWERTY_L2__________________, KC_BSLS, + KC_LSFT, __________________QWERTY_L3__________________, + KC_LGUI, MACRO_1, MACRO_2, MACRO_3, MACRO_4, KC_LOCK, + KC_SPC, KC_BTN2, MO(_LOWER) + ), + [_GAME_LOWER] = LAYOUT_moonlander_gamepad( + KC_GRV, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, + KC_TAB, __________________QWERTY_L1__________________, KC_SLSH, + KC_LALT, __________________QWERTY_L2__________________, KC_BSLS, + KC_LSFT, __________________QWERTY_L3__________________, + KC_LGUI, MACRO_5, MACRO_6, MACRO_7, MACRO_8, KC_LOCK, + KC_SPC, KC_BTN2, MO(_LOWER) + ) +}; +// clang-format on + +layer_state_t layer_state_set_keymap(layer_state_t state) { + ML_LED_1(0); + ML_LED_2(0); + ML_LED_3(0); + ML_LED_4(0); + ML_LED_5(0); + ML_LED_6(0); + state = update_tri_layer_state(state, _GAME, _LOWER, _GAME_LOWER); + switch (get_highest_layer(state)) { + case 1: + ML_LED_1(1); + ML_LED_4(1); + break; + case 2: + ML_LED_2(1); + ML_LED_5(1); + break; + case 3: + ML_LED_3(1); + break; + case 4: + ML_LED_4(1); + break; + case 5: + ML_LED_5(1); + break; + case 6: + ML_LED_6(1); + break; + default: + break; + } + + return state; +} diff --git a/keyboards/moonlander/keymaps/jjerrell/readme.md b/keyboards/moonlander/keymaps/jjerrell/readme.md new file mode 100644 index 0000000000..51476f8ab9 --- /dev/null +++ b/keyboards/moonlander/keymaps/jjerrell/readme.md @@ -0,0 +1,3 @@ +# Jacob Jerrell's Moonlander Keymap + +Concrete proof and acceptance of a problem. There is some not so custom Moonlander LED control in here but everything else is implemented in [my userspace](../../../../users/jjerrell/). diff --git a/keyboards/moonlander/keymaps/jjerrell/rules.mk b/keyboards/moonlander/keymaps/jjerrell/rules.mk new file mode 100644 index 0000000000..ef72559a0c --- /dev/null +++ b/keyboards/moonlander/keymaps/jjerrell/rules.mk @@ -0,0 +1 @@ +AUDIO_ENABLE = yes diff --git a/layouts/community/ergodox/bocaj/config.h b/layouts/community/ergodox/bocaj/config.h deleted file mode 100644 index 621ae784cf..0000000000 --- a/layouts/community/ergodox/bocaj/config.h +++ /dev/null @@ -1,4 +0,0 @@ -#pragma once - -#define LEADER_TIMEOUT 250 -#define LEADER_PER_KEY_TIMING diff --git a/layouts/community/ergodox/bocaj/keymap.c b/layouts/community/ergodox/bocaj/keymap.c deleted file mode 100644 index ba105a8f1d..0000000000 --- a/layouts/community/ergodox/bocaj/keymap.c +++ /dev/null @@ -1,175 +0,0 @@ -/* -Copyright 2020 Jacob Jerrell @JacobJerrell - -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 . -*/ - -#include "bocaj.h" - -/* - * The `LAYOUT_ergodox_pretty_base` macro is a template to allow the use of - * identical modifiers for the default layouts (eg QWERTY, Colemak, Dvorak, - * etc), so that there is no need to set them up for each layout, and modify - * all of them if I want to change them. This helps to keep consistency and - * ease of use. K## is a placeholder to pass through the individual keycodes - */ -#define LAYOUT_ergodox_bocaj(...) WRAPPER_ergodox_bocaj(__VA_ARGS__) -#define LAYOUT_ergodox_bocaj_WIN(...) WRAPPER_ergodox_bocaj_WIN(__VA_ARGS__) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [_WORKMAN] = LAYOUT_ergodox_bocaj( - KC_ESC, ________________NUMBER_LEFT________________, KC_ARRW, KC_MINS, ________________NUMBER_RIGHT_______________, KC_EQUAL, - KC_DEL, _________________WORKMAN_L1________________, KC_LPRN, KC_RPRN, _________________WORKMAN_R1________________, KC_BSLS, - _______, _________________WORKMAN_L2________________, _________________WORKMAN_R2________________, KC_QUOT, - KC_LSFT, _________________WORKMAN_L3________________, KC_LBRC, KC_RBRC, _________________WORKMAN_R3________________, _______, - MO_MOD, KC_PGUP, KC_HOME, KC_UP, KC_LEFT, KC_RIGHT, KC_DOWN, KC_END, KC_PGDN, WORKMAN, - KC_APP,KC_HOME, /* <- LHS/RHS -> */ KC_END,KC_ESC, - KC_PGUP, /* <- LHS/RHS -> */ KC_PGDN, - KC_SPACE,KC_BSPACE,KC_LEAD, /* <- LHS/RHS -> */ KC_LOCK,KC_TAB,KC_ENTER - ), - - [_WWORKMAN] = LAYOUT_ergodox_bocaj_WIN( - KC_ESC, ________________NUMBER_LEFT________________, KC_ARRW, KC_MINS, ________________NUMBER_RIGHT_______________, KC_EQUAL, - KC_DEL, _________________WORKMAN_L1________________, KC_LPRN, KC_RPRN, _________________WORKMAN_R1________________, KC_BSLS, - _______, _________________WORKMAN_L2________________, _________________WORKMAN_R2________________, KC_QUOT, - KC_LSFT, _________________WORKMAN_L3________________, KC_LBRC, KC_RBRC, _________________WORKMAN_R3________________, _______, - MO_MOD, KC_PGUP, KC_HOME, KC_UP, KC_LEFT, KC_RIGHT, KC_DOWN, KC_END, KC_PGDN, WORKMAN, - KC_APP,KC_HOME, /* <- LHS/RHS -> */ KC_END,KC_ESC, - KC_PGUP, /* <- LHS/RHS -> */ KC_PGDN, - KC_SPACE,KC_BSPACE,KC_LEAD, /* <- LHS/RHS -> */ KC_LOCK,KC_TAB,KC_ENTER - ), - - [_LOWER] = LAYOUT_ergodox_bocaj( - KC_GRV, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, KC_UP, _______, _______, _______, _______, _______, KC_7, KC_8, KC_9, KC_BSLS, _______, - _______, _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______, KC_4, KC_5, KC_6, KC_ASTR, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_1, KC_2, KC_3, KC_PLUS, _______, - _______, _______, _______, _______, _______, KC_0, KC_DOT, KC_COMM, KC_MINS, _______, - KC_APP,KC_HOME, /* <- LHS/RHS -> */ KC_END,KC_ESC, - KC_PGUP, /* <- LHS/RHS -> */ KC_PGDN, - KC_SPACE,KC_BSPACE,KC_LEAD, /* <- LHS/RHS -> */ KC_LOCK,KC_TAB,KC_ENTER - ), - - [_RAISE] = LAYOUT_ergodox_bocaj( - KC_TILD, _________________RAISE_L1__________________, _______, _______, _________________RAISE_R1__________________, _______, - KC_F11, _________________RAISE_L2__________________, _______, _______, _________________RAISE_R2__________________, KC_F12, - _______, _________________RAISE_L3__________________, _________________RAISE_R3__________________, _______, - _______, _______, KC_MRWD, KC_MPLY, KC_MFFD, _______, _______, _______, ___________________BLANK___________________, _______, - ___________________BLANK___________________, ___________________BLANK___________________, - KC_APP,KC_HOME, /* <- LHS/RHS -> */ KC_END,KC_ESC, - KC_PGUP, /* <- LHS/RHS -> */ KC_PGDN, - KC_SPACE,KC_BSPACE,KC_LEAD, /* <- LHS/RHS -> */ KC_LOCK,KC_TAB,KC_ENTER - ), - - [_ADJUST] = LAYOUT_ergodox_pretty( - KC_MAKE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_RST, - VRSN, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, EEP_RST, - _______, KC__MUTE, KC__VOLDOWN, KC__VOLUP, _______, KC_MNXT, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - KC_APP,KC_HOME, /* <- LHS/RHS -> */ KC_END,KC_ESC, - KC_PGUP, /* <- LHS/RHS -> */ KC_PGDN, - KC_SPACE,KC_BSPACE,KC_LEAD, /* <- LHS/RHS -> */ KC_LOCK,KC_TAB,KC_ENTER - ), - - // Wrapping Mouse-Wheel Keys with `X_T()` style functions seems - // to break the mouse button. So we can't use the wrapper here. - [_MOD] = LAYOUT_ergodox_pretty( - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, KC_WH_D, _______, _______, _______, _______, _______, _______, KC_MS_U, _______, _______, _______, - _______, _______, KC_WH_L, KC_WH_U, KC_WH_R, _______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, - _______, _______, _______, _______, KC_ACL0, KC_ACL1, KC_ACL2, _______, _______, _______, - _______,_______, /* <- LHS/RHS -> */ _______,_______, - _______, /* <- LHS/RHS -> */ _______, - KC_BTN1,KC_BTN2,_______, /* <- LHS/RHS -> */ _______,KC_BTN3,KC_BTN4 - ) - -}; -// clang-format on - -bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - return true; -} - -void matrix_init_keymap(void) {}; - -// Runs whenever there is a layer state change. -layer_state_t layer_state_set_keymap(layer_state_t state) { - ergodox_board_led_off(); - ergodox_right_led_1_off(); - ergodox_right_led_2_off(); - ergodox_right_led_3_off(); - - uint8_t layer = get_highest_layer(state); - switch (layer) { - case _LOWER: - ergodox_right_led_3_on(); - break; - case _MOD: - ergodox_right_led_2_on(); - break; - case _RAISE: - ergodox_right_led_1_on(); - break; - case _ADJUST: - ergodox_right_led_1_on(); - ergodox_right_led_2_on(); - break; - default: - break; - } - - ergodox_right_led_1_set(25); - ergodox_right_led_2_set(25); - ergodox_right_led_3_set(25); - - return state; -}; - -void matrix_scan_keymap(void) { - uint8_t modifiers = get_mods(); - uint8_t led_usb_state = host_keyboard_leds(); - uint8_t one_shot = get_oneshot_mods(); - uint8_t layer_is_workman = layer_state_is(_WORKMAN); - - if ((modifiers) && (layer_is_workman)) { - if (modifiers & MODS_SHIFT_MASK || led_usb_state & (1< +// +// This file is part of qmk_firmware. +// +// qmk_firmware 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 3 of the License, or +// (at your option) any later version. +// +// qmk_firmware 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 qmk_firmware. If not, see . + +#ifdef KEYBOARD_ergodox_ez +#undef PRODUCT +#define PRODUCT ErgoDox EZ - Modified by <@jjerrell> +#endif diff --git a/layouts/community/ergodox/jjerrell/keymap.c b/layouts/community/ergodox/jjerrell/keymap.c new file mode 100644 index 0000000000..110a8aba63 --- /dev/null +++ b/layouts/community/ergodox/jjerrell/keymap.c @@ -0,0 +1,129 @@ +/** + * Copyright (C) 2021 Jerrell, Jacob <@jjerrell> + * + * This file is part of qmk_firmware. + * + * qmk_firmware 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 3 of the License, or + * (at your option) any later version. + * + * qmk_firmware 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 qmk_firmware. If not, see . + */ + +#include "jjerrell.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + // clang-format off + [_WORKMAN] = LAYOUT_ergodox_mods( + __________________WORKMN_L1__________________, __________________WORKMN_R1__________________, + __________________WORKMN_L2__________________, __________________WORKMN_R2__________________, + __________________WORKMN_L3__________________, __________________WORKMN_R3__________________, + XXXXXXX, XXXXXXX, XXXXXXX, KC_LSFT, KC_RSFT, XXXXXXX, XXXXXXX, XXXXXXX + ), + /* Lower - Nav/Select/Nums */ + [_LOWER] = LAYOUT_ergodox_mods( + __________________LOWER_L1___________________, __________________LOWER_R1___________________, + __________________LOWER_L2___________________, __________________LOWER_R2___________________, + __________________LOWER_L3___________________, __________________LOWER_R3___________________, + XXXXXXX, XXXXXXX, XXXXXXX, KC_LSFT, KC_0, KC_DOT, KC_COMM, KC_PLUS + ), + /* Raise - Symbols */ + [_RAISE] = LAYOUT_ergodox_common( + __________________RAISE_L1___________________, __________________RAISE_R1___________________, + __________________RAISE_L2___________________, __________________RAISE_R2___________________, + __________________RAISE_L3___________________, __________________RAISE_R3___________________, + XXXXXXX, XXXXXXX, XXXXXXX, KC_LSFT, KC_RSFT, XXXXXXX, XXXXXXX, XXXXXXX + ), + /* Adjust (Lower + Raise) */ + [_ADJUST] = LAYOUT_ergodox_common( + __________________ADJUST_L1__________________, __________________ADJUST_R1__________________, + __________________ADJUST_L2__________________, __________________ADJUST_R2__________________, + __________________ADJUST_L3__________________, __________________ADJUST_R3__________________, + XXXXXXX, XXXXXXX, XXXXXXX, KC_LSFT, KC_RSFT, XXXXXXX, XXXXXXX, XXXXXXX + ), + [_SPECIAL] = LAYOUT_ergodox_common( + XXXXXXX, XXXXXXX, KC_WH_D, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, KC_WH_L, KC_WH_U, KC_WH_R, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, + XXXXXXX, XXXXXXX, XXXXXXX, KC_LALT, KC_RALT, XXXXXXX, XXXXXXX, XXXXXXX + ) +// clang-format on +}; + +#ifdef KEYBOARD_ergodox_ez +// Runs whenever there is a layer state change. +layer_state_t layer_state_set_keymap(layer_state_t state) { + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + + uint8_t layer = get_highest_layer(state); + switch (layer) { + case _LOWER: + ergodox_right_led_3_on(); + break; + case _RAISE: + ergodox_right_led_1_on(); + break; + case _ADJUST: + ergodox_right_led_1_on(); + ergodox_right_led_2_on(); + ergodox_right_led_3_on(); + break; + case _SPECIAL: + ergodox_right_led_2_on(); + break; + default: + break; + } + + ergodox_right_led_1_set(25); + ergodox_right_led_2_set(25); + ergodox_right_led_3_set(25); + + return state; +}; + +void matrix_scan_keymap(void) { + uint8_t modifiers = get_mods(); + uint8_t led_usb_state = host_keyboard_leds(); + uint8_t one_shot = get_oneshot_mods(); + uint8_t layer_is_workman = layer_state_is(_WORKMAN); + + if ((modifiers) && (layer_is_workman)) { + if (modifiers & MOD_MASK_SHIFT || led_usb_state & (1< @JacobJerrell - -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 . -*/ - -#include "bocaj.h" - -#ifdef BACKLIGHT_ENABLE -enum planck_keycodes { - BACKLIT = NEW_SAFE_RANGE, - TH_LVL, -}; - -#else -# define BACKLIT OSM(MOD_LSFT) -enum planck_keycodes { - TH_LVL = NEW_SAFE_RANGE, -}; -#endif - -/* - * Tap/Hold Wrapper - * ,-----------------------------------------------------------------------------------. - * | | | | | | | | | | | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | |Shift | Cmd | Alt | | | Alt | Cmd |Shift | | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | Ctrl | | | | | | | | | Ctrl | | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | | | | |Lower | |Raise | | | | | - * `-----------------------------------------------------------------------------------' - */ -#define LAYOUT_ortho_4x12_bocaj(...) WRAPPER_planck_bocaj(__VA_ARGS__) - -/* - * Base Alphanumeric Wrapper + Tap/Hold Wrapper - * ,-----------------------------------------------------------------------------------. - * | Esc | | | | | | | | | | | - | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Tab | | | | | HYPR | MEH | | | | | ' | - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | Shift| | | | | | | | | | | TTMOD| - * |------+------+------+------+------+------+------+------+------+------+------+------| - * | MOMOD| Lead | Up | Left |BkSpc | Space |Enter |Right | Down | XXX | XXX | - * `-----------------------------------------------------------------------------------' - */ -#define LAYOUT_ortho_4x12_bocaj_base(...) WRAPPER_planck_bocaj_base(__VA_ARGS__) -#define LAYOUT_ortho_4x12_bocaj_base_WIN(...) WRAPPER_planck_bocaj_base_WIN(__VA_ARGS__) - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - - [_WORKMAN] = LAYOUT_ortho_4x12_bocaj_base( - _________________WORKMAN_L1________________, _________________WORKMAN_R1________________, - _________________WORKMAN_L2________________, _________________WORKMAN_R2________________, - _________________WORKMAN_L3________________, _________________WORKMAN_R3________________ - ), - [_WWORKMAN] = LAYOUT_ortho_4x12_bocaj_base_WIN( - _________________WORKMAN_L1________________, _________________WORKMAN_R1________________, - _________________WORKMAN_L2________________, _________________WORKMAN_R2________________, - _________________WORKMAN_L3________________, _________________WORKMAN_R3________________ - ), - - [_QWERTY] = LAYOUT_ortho_4x12_bocaj_base( - _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, - _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, - _________________QWERTY_L3_________________, _________________QWERTY_R3_________________ - ), - [_WQWERTY] = LAYOUT_ortho_4x12_bocaj_base_WIN( - _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, - _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, - _________________QWERTY_L3_________________, _________________QWERTY_R3_________________ - ), - - [_LOWER] = LAYOUT_ortho_4x12_bocaj( - ___________________LOWER_L1_EXT____________________, ___________________LOWER_R1_EXT____________________, - ___________________LOWER_L2_EXT____________________, ___________________LOWER_R2_EXT____________________, - ___________________LOWER_L3_EXT____________________, ___________________LOWER_R3_EXT____________________, - _______, _______, _______, _______, _______, _______, _______, KC_0, KC_DOT, KC_COMM, _______, _______ - ), - - [_RAISE] = LAYOUT_ortho_4x12_bocaj( - KC_TILD, _________________RAISE_L1__________________, _________________RAISE_R1__________________, KC_EQUAL, - KC_F11, _________________RAISE_L2__________________, _________________RAISE_R2__________________, KC_F12, - _______, _________________RAISE_L3__________________, _________________RAISE_R3__________________, _______, - _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ), - - [_ADJUST] = WRAPPER_ortho_4x12( - KC_MAKE, _________________ADJUST_L1_________________, _________________ADJUST_R1_________________, KC_RST, - VRSN, _________________ADJUST_L2_________________, _________________ADJUST_R2_________________, EEP_RST, - TH_LVL, _________________ADJUST_L3_________________, _________________ADJUST_R3_________________, RGB_IDL, - HPT_TOG, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ - ) - -}; -// clang-format on - -bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { -#ifdef BACKLIGHT_ENABLE - case BACKLIT: - if (record->event.pressed) { - register_code(KC_RSFT); -# ifdef BACKLIGHT_ENABLE - backlight_step(); -# endif - } else { - unregister_code(KC_RSFT); - } - break; -#endif -#ifdef KEYBOARD_planck_ez - case TH_LVL: - if (record->event.pressed) { - keyboard_config.led_level++; - if (keyboard_config.led_level > 4) { - keyboard_config.led_level = 0; - } - planck_ez_right_led_level((uint8_t)keyboard_config.led_level * 255 / 4); - planck_ez_left_led_level((uint8_t)keyboard_config.led_level * 255 / 4); - eeconfig_update_kb(keyboard_config.raw); - layer_state_set_kb(layer_state); - } - break; -#endif - } - return true; -} - -bool music_mask_user(uint16_t keycode) { - switch (keycode) { - default: - return true; - } -} - -#ifdef RGB_MATRIX_ENABLE - -// clang-format off -void suspend_power_down_keymap(void) { - rgb_matrix_set_suspend_state(true); -} - -void suspend_wakeup_init_keymap(void) { - rgb_matrix_set_suspend_state(false); -} -// clang-format on - -void rgb_matrix_indicators_user(void) { - uint8_t this_mod = get_mods(); - uint8_t this_led = host_keyboard_leds(); - uint8_t this_osm = get_oneshot_mods(); - bool is_ez; -# ifdef KEYBOARD_planck_ez - is_ez = true; -# endif - - if (g_suspend_state || !rgb_matrix_config.enable) return; - -# if defined(RGBLIGHT_ENABLE) - if (!userspace_config.rgb_layer_change) -# else - if (userspace_config.rgb_layer_change) -# endif - { - switch (get_highest_layer(layer_state)) { - case _MOD: - rgb_matrix_layer_helper(HSV_ORANGE, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER); - break; - case _RAISE: - rgb_matrix_layer_helper(HSV_BLUE, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER); - break; - case _LOWER: - rgb_matrix_layer_helper(HSV_GREEN, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER); - break; - case _ADJUST: - rgb_matrix_layer_helper(HSV_RED, 1, rgb_matrix_config.speed, LED_FLAG_MODIFIER); - break; - default: { - bool mods_enabled = false; - switch (get_highest_layer(default_layer_state)) { - case _QWERTY: - rgb_matrix_layer_helper(HSV_CYAN, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); - break; - case _WQWERTY: - rgb_matrix_layer_helper(HSV_BLUE, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); - break; - case _WORKMAN: - rgb_matrix_layer_helper(HSV_SPRINGGREEN, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); - break; - case _WWORKMAN: - rgb_matrix_layer_helper(HSV_GREEN, mods_enabled, rgb_matrix_config.speed, LED_FLAG_MODIFIER); - break; - } - break; - } - } - } - - switch (get_highest_layer(default_layer_state)) { - case _QWERTY: - rgb_matrix_set_color(is_ez ? 41 : 42, 0x00, 0xFF, 0xFF); - break; - case _WORKMAN: - rgb_matrix_set_color(is_ez ? 41 : 42, 0xD9, 0xA5, 0x21); - break; - } - - if ((this_mod | this_osm) & MODS_SHIFT_MASK || this_led & (1 << USB_LED_CAPS_LOCK)) { - rgb_matrix_set_color_row(0, 0x00, 0xFF, 0x00); - } - if ((this_mod | this_osm) & MODS_CTRL_MASK && (this_mod | this_osm) & MODS_GUI_MASK) { - rgb_matrix_set_color_row(1, 0xFF, 0xD9, 0xFF); - } else if ((this_mod | this_osm) & MODS_CTRL_MASK) { - rgb_matrix_set_color_row(1, 0xFF, 0x00, 0x00); - } else if ((this_mod | this_osm) & MODS_GUI_MASK) { - rgb_matrix_set_color_row(1, 0xFF, 0xD9, 0x00); - } - if ((this_mod | this_osm) & MODS_ALT_MASK) { - rgb_matrix_set_color_row(2, 0x00, 0x00, 0xFF); - } -} -#endif // RGB_MATRIX_INIT - -void matrix_init_keymap(void) {} - -#ifdef ENCODER_ENABLE -bool encoder_update_user(uint8_t index, bool clockwise) { - switch (get_highest_layer(layer_state)) { - case _RAISE: - clockwise ? tap_code(KC_VOLD) : tap_code(KC_VOLU); - break; - case _LOWER: -# ifdef RGB_MATRIX_ENABLE - clockwise ? rgb_matrix_step() : rgb_matrix_step_reverse(); -# else - clockwise ? tap_code(KC_PGDN) : tap_code(KC_PGUP); -# endif - break; - case _ADJUST: -# ifdef AUDIO_CLICKY - clockwise ? clicky_freq_up() : clicky_freq_down(); -# endif - break; - default: - clockwise ? tap_code(KC_DOWN) : tap_code(KC_UP); - } -# ifdef AUDIO_CLICKY - clicky_play(); -# endif - return true; -} -#endif // ENCODER_ENABLE - -#ifdef KEYBOARD_planck_ez -layer_state_t layer_state_set_keymap(layer_state_t state) { - planck_ez_left_led_off(); - planck_ez_right_led_off(); - switch (get_highest_layer(state)) { - case _LOWER: - planck_ez_left_led_on(); - break; - case _RAISE: - planck_ez_right_led_on(); - break; - case _ADJUST: - planck_ez_right_led_on(); - planck_ez_left_led_on(); - break; - default: - break; - } - return state; -} -#endif diff --git a/layouts/community/ortho_4x12/bocaj/readme.md b/layouts/community/ortho_4x12/bocaj/readme.md deleted file mode 100644 index a3716b8dc0..0000000000 --- a/layouts/community/ortho_4x12/bocaj/readme.md +++ /dev/null @@ -1,23 +0,0 @@ -# Overview - -This is my Planck EZ layout, heavily based upon [my ergodox layout](../../ergodox/bocaj/). - -I got this keyboard for two reasons: - -1. QMK spoiled me and the Ergodox isn't incredibly portable (ok 3 reasons) -2. This can sit ontop of my janky Macbook Pro keyboard (disabled with Karabiner if the planck is connected) when I want to work from the couch. - -## How to Build - -Put simply: -`make planck/ez:bocaj` - -On that note, I use a separate workspace when making changes to my layouts or userspace. In that repo, there is a tool that does this for me. See [JacobJerrell/qmk_layouts/tools/](https://github.com/JacobJerrell/qmk_layouts/tree/master/tools) until I get documentation finished (Write code first, define requirements second... right?). - -## Layers - -* WORKMAN/QWERTY: Default is workman, can be switched via the ADJUST layer. Idk why you would though. -* LOWER: Nums across the top, switches enter key to tab and tab key to delete. Symbols in the middle, remenascent of the ergodox -* RAISE: Symbols across the top, F-Keys on the 2nd row. Switches backspace to delete -* ADJUST: Computer Audio controls, RGB controls, Sound controls, macros, etc. -* MOD: Mouse controls under the left hand. Numpad under the right hand \ No newline at end of file diff --git a/layouts/community/ortho_4x12/bocaj/rules.mk b/layouts/community/ortho_4x12/bocaj/rules.mk deleted file mode 100644 index 5c642e65ca..0000000000 --- a/layouts/community/ortho_4x12/bocaj/rules.mk +++ /dev/null @@ -1,43 +0,0 @@ -BOOTMAGIC_ENABLE = lite # Virtual DIP switch configuration(+1000) -MOUSEKEY_ENABLE = no # Mouse keys(+4700) -EXTRAKEY_ENABLE = yes # Audio control and System control(+450) -TAP_DANCE_ENABLE = no -SPACE_CADET_ENABLE = no -NKRO_ENABLE = yes - -ifneq ($(strip $(KEYBOARD)), planck/rev6) - CONSOLE_ENABLE = no - COMMAND_ENABLE = no - ifeq ($(strip $(LAYOUT_HAS_RGB)), yes) - RGBLIGHT_ENABLE = yes - INDICATOR_LIGHTS = yes - RGBLIGHT_TWINKLE = yes - RGBLIGHT_STARTUP_ANIMATION = yes - endif -else - CONSOLE_ENABLE = yes - COMMAND_ENABLE = yes - RGBLIGHT_ENABLE = yes - RGBLIGHT_STARTUP_ANIMATION = yes - RGB_MATRIX_ENABLE = no - AUDIO_ENABLE = yes - EEPROM_DRIVER = i2c -endif -ifeq ($(strip $(KEYBOARD)), planck/light) - RGB_MATRIX_ENABLE = yes - RGBLIGHT_ENABLE = yes - RGBLIGHT_STARTUP_ANIMATION = yes - AUDIO_ENABLE = yes - # HAPTIC_ENABLE += SOLENOID -endif -ifeq ($(strip $(KEYBOARD)), planck/ez) - RGBLIGHT_ENABLE = no - ENCODER_ENABLE = yes - RGB_MATRIX_ENABLE = IS31FL3737 - INDICATOR_LIGHTS = yes - RGBLIGHT_TWINKLE = yes - RGBLIGHT_STARTUP_ANIMATION = yes - CONSOLE_ENABLE = yes - COMMAND_ENABLE = yes - AUDIO_ENABLE = yes -endif diff --git a/layouts/community/ortho_4x12/jjerrell/config.h b/layouts/community/ortho_4x12/jjerrell/config.h new file mode 100644 index 0000000000..aee885b8d0 --- /dev/null +++ b/layouts/community/ortho_4x12/jjerrell/config.h @@ -0,0 +1,57 @@ +// Copyright (C) 2021 Jerrell, Jacob <@jjerrell> +// +// This file is part of qmk_firmware. +// +// qmk_firmware 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 3 of the License, or +// (at your option) any later version. +// +// qmk_firmware 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 qmk_firmware. If not, see . + +#pragma once + +// Allows time for repositioning hands due to awkward key placement +#define LEADER_NO_TIMEOUT + +#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) \ + } +#endif + +#ifdef KEYBOARD_planck_ez_glow +#undef PRODUCT +#define PRODUCT Planck EZ Glow - Modified by <@jjerrell> +#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 diff --git a/layouts/community/ortho_4x12/jjerrell/keymap.c b/layouts/community/ortho_4x12/jjerrell/keymap.c new file mode 100644 index 0000000000..d873907e91 --- /dev/null +++ b/layouts/community/ortho_4x12/jjerrell/keymap.c @@ -0,0 +1,227 @@ +/* Copyright 2015-2017 Jack Humbert + * Copyright 2021 Jacob Jerrell <@jjerrell> + * + * 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 . + */ + +#include "jjerrell.h" + +enum planck_layers { + _GAME_LOWER = LAYER_SAFE_RANGE, + // _GAME_RAISE, +}; + +#define LAYOUT_planck_plain(...) WRAPPER_ortho_4x12(__VA_ARGS__) + +// clang-format off +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_WORKMAN] = LAYOUT_planck_base( + __________________WORKMN_L1__________________, __________________WORKMN_R1__________________, + __________________WORKMN_L2__________________, __________________WORKMN_R2__________________, + __________________WORKMN_L3__________________, __________________WORKMN_R3__________________ + ), + /* Lower - Nav/Select/Nums + * ,-----------------------------------------------------------------------------------. + * | PGUP | BSPC | UP | DEL | PGDN | | | | 7 | 8 | 9 | * | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | HOME | LEFT | DOWN | RGHT | END | | | | 4 | 5 | 6 | / | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | ESC | TAB | | ENTR | | | | | 1 | 2 | 3 | - | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | held | SPACE | ENTR | 0 | . | , | + | + * `-----------------------------------------------------------------------------------' + */ + [_LOWER] = LAYOUT_planck_mods( + __________________LOWER_L1___________________, XXXXXXX, XXXXXXX, __________________LOWER_R1___________________, + __________________LOWER_L2___________________, XXXXXXX, XXXXXXX, __________________LOWER_R2___________________, + __________________LOWER_L3___________________, XXXXXXX, XXXXXXX, __________________LOWER_R3___________________, + _________________________________________PLANCK_LOWER_BOTTOM_ROW_________________________________________ + ), + /* Raise - Symbols + * ,-----------------------------------------------------------------------------------. + * | % | _ | [ | ] | ^ | | | ! | < | > | = | : | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | \ | / | { | } | * | | | ? | ( | ) | - | ; | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | # | $ | | | ~ | ` | | | @ | " | ' | + | & | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | LEAD | | | BSPC | SPACE | held | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_RAISE] = LAYOUT_planck_common( + __________________RAISE_L1___________________, __________________RAISE_R1___________________, + __________________RAISE_L2___________________, __________________RAISE_R2___________________, + __________________RAISE_L3___________________, __________________RAISE_R3___________________ + ), + /* Adjust (Lower + Raise) + * ,-----------------------------------------------------------------------------------. + * | Make | Debug|Reset |TermOn|TrmOff| | |MusMod|Mus On|MusOff|MidiOn|MidOff| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Mute | Vol- | Vol+ | Play | Skip | | |Voice-| HUE+ | HUE- | SAT+ | SAT- | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | Vrsn | AudOn|AudOff|CGswap|CGnorm| | |Voice+|RGBTog|RGBMod|BRGHT+|BRGHT-| + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | held | | held | | | | | + * `-----------------------------------------------------------------------------------' + */ + [_ADJUST] = LAYOUT_planck_common( + __________________ADJUST_L1__________________, __________________ADJUST_R1__________________, + __________________ADJUST_L2__________________, __________________ADJUST_R2__________________, + __________________ADJUST_L3__________________, __________________ADJUST_R3__________________ + ), + [_GAME] = LAYOUT_planck_plain( + __________________QWERTY_L1__________________, _______, _______, XXXXXXX, KC_9, KC_0, KC_MINS, KC_EQL, + __________________QWERTY_L2__________________, XXXXXXX, XXXXXXX, XXXXXXX, KC_5, KC_6, KC_7, KC_8, + __________________QWERTY_L3__________________, XXXXXXX, XXXXXXX, XXXXXXX, KC_1, KC_2, KC_3, KC_4, + KC_LSFT, KC_LGUI, KC_LALT, KC_LCTL, LT(_LOWER, KC_BSPC), KC_SPC, XXXXXXX, LT(_WORKMAN, KC_ENT), MACRO_1, MACRO_2, MACRO_3, MACRO_4 + ), + [_GAME_LOWER] = LAYOUT_planck_plain( + _______, _______, _______, _______, _______, _______, _______, _______, C(_______), C(_______), C(_______), C(_______), + _______, _______, _______, _______, _______, XXXXXXX, XXXXXXX, _______, C(_______), C(_______), C(_______), C(_______), + _______, _______, _______, _______, _______, XXXXXXX, XXXXXXX, _______, C(_______), C(_______), C(_______), C(_______), + MACRO_1, MACRO_2, MACRO_3, MACRO_4, _______, _______, XXXXXXX, _______, MACRO_5, MACRO_6, MACRO_7, MACRO_8 + ) + +}; +// clang-format on + +bool muse_mode = false; +uint8_t last_muse_note = 0; +uint16_t muse_counter = 0; +uint8_t muse_offset = 70; +uint16_t muse_tempo = 50; + +#ifdef KEYBOARD_planck_ez +void planck_ez_teeth_set(layer_state_t state) { + switch (get_highest_layer(state)) { + case _LOWER: + planck_ez_left_led_level(40); + break; + case _RAISE: + planck_ez_right_led_level(40); + break; + case _ADJUST: + planck_ez_left_led_level(40); + planck_ez_right_led_level(40); + break; + case _GAME_LOWER: + planck_ez_left_led_level(20); + break; +// todo case _GAME_RAISE: + // planck_ez_right_led_level(20); + // break; + case _WORKMAN: + if (IS_LAYER_ON(_GAME)) { + planck_ez_left_led_level(60); + planck_ez_right_led_level(60); + break; + } + default: + planck_ez_left_led_off(); + planck_ez_right_led_off(); + break; + } +} + +layer_state_t layer_state_set_keymap(layer_state_t state) { + planck_ez_left_led_off(); + planck_ez_right_led_off(); + state = update_tri_layer_state(state, _GAME, _LOWER, _GAME_LOWER); + planck_ez_teeth_set(state); + return state; +} +#endif + +bool encoder_update(bool clockwise) { + if (muse_mode) { + if (IS_LAYER_ON(_RAISE)) { + if (clockwise) { + muse_offset++; + } else { + muse_offset--; + } + } else { + if (clockwise) { + muse_tempo+=1; + } else { + muse_tempo-=1; + } + } + } else { + if (clockwise) { +# ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_DOWN); +# else + tap_code(KC_PGDN); +# endif + } else { +# ifdef MOUSEKEY_ENABLE + tap_code(KC_MS_WH_UP); +# else + tap_code(KC_PGUP); +# endif + } + } + return true; +} + +void dip_switch_update_keymap(uint8_t index, bool active) { + switch (index) { + case 0: { + if (active) { + layer_on(_ADJUST); + } else { + layer_off(_ADJUST); + } + break; + } + case 1: + if (active) { + muse_mode = true; + } else { + muse_mode = false; + } + } +} + +#ifdef AUDIO_ENABLE +void matrix_scan_keymap(void) { + if (muse_mode) { + if (muse_counter == 0) { + uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()]; + if (muse_note != last_muse_note) { + stop_note(compute_freq_for_midi_note(last_muse_note)); + play_note(compute_freq_for_midi_note(muse_note), 0xF); + last_muse_note = muse_note; + } + } + muse_counter = (muse_counter + 1) % muse_tempo; + } else { + if (muse_counter) { + stop_all_notes(); + muse_counter = 0; + } + } +} +#endif + +bool music_mask_keymap(uint16_t keycode) { + switch (keycode) { + case _RAISE: + case _LOWER: + return false; + default: + return true; + } +} diff --git a/layouts/community/ortho_4x12/jjerrell/readme.md b/layouts/community/ortho_4x12/jjerrell/readme.md new file mode 100644 index 0000000000..ec947ea353 --- /dev/null +++ b/layouts/community/ortho_4x12/jjerrell/readme.md @@ -0,0 +1,7 @@ +# JJerrell's Planck EZ Layout + +As with my other keymaps, this layout is a close adaptation of the Neo keyboard. Obvious differences are that the alpha keymap is Workman and if you're already used to the secondary layers of the Neo keymap, this might be very uncomfortable for you because of slight variations. + +The keymap has been setup to pretty much remove the center columns above the spacebar and limit use of the bottom row by supplying paths to removed functionality that are simpler to process mentally and require less finger acrobatics. + +My ownership of this keyboard could not have been easily predicted because my original justification of this hobby was health related. I found QMK through the Ergodox EZ and this keyboard is a result of that discovery -- I could not live without some QMK features. As you can see, my problem has come full circle... now I use this keyboard when I'm not at a desk and it's tiny. This is offset by eliminating use of the center columns, relying on a symbol layer almost exclusively, and relying on a navigation layer instead of getting by with the minimum on the alpha layers which became uncomfortable even with the thumbs doing the heavy lifting and mods being comfortably placed on the home row. diff --git a/layouts/community/ortho_4x12/jjerrell/rules.mk b/layouts/community/ortho_4x12/jjerrell/rules.mk new file mode 100644 index 0000000000..39f31a266e --- /dev/null +++ b/layouts/community/ortho_4x12/jjerrell/rules.mk @@ -0,0 +1,8 @@ +SRC += muse.c + +BOOTMAGIC_ENABLE = lite +MOUSEKEY_ENABLE = no +EXTRAKEY_ENABLE = yes +TAP_DANCE_ENABLE = no +SPACE_CADET_ENABLE = no +NKRO_ENABLE = no diff --git a/users/bocaj/.gitignore b/users/bocaj/.gitignore deleted file mode 100644 index c6df8c0139..0000000000 --- a/users/bocaj/.gitignore +++ /dev/null @@ -1 +0,0 @@ -secrets.c diff --git a/users/bocaj/.gitlab-ci.yml b/users/bocaj/.gitlab-ci.yml deleted file mode 100644 index 71e3d26eb4..0000000000 --- a/users/bocaj/.gitlab-ci.yml +++ /dev/null @@ -1,24 +0,0 @@ -stages: - - test - -QMK Firmware: - stage: test - variables: - GIT_SUBMODULE_STRATEGY: recursive - tags: - - linux - image: qmkfm/base_container - before_script: - - apt-get update -qy - - apt-get install -y build-essential avr-libc binutils-arm-none-eabi binutils-avr dfu-programmer dfu-util gcc gcc-arm-none-eabi git libnewlib-arm-none-eabi gcc-avr python3 unzip wget zip - - avr-gcc --version - - uname -a - script: - - make planck/rev6:default planck/rev5:default - - make all:bocaj -j2 - artifacts: - name: "$CI_JOB_NAME-$CI_COMMIT_REF_SLUG" - paths: - - ./*.hex - - ./*.bin - expire_in: 1 month diff --git a/users/bocaj/bocaj.c b/users/bocaj/bocaj.c deleted file mode 100644 index 83fe812311..0000000000 --- a/users/bocaj/bocaj.c +++ /dev/null @@ -1,210 +0,0 @@ -/* -Copyright 2020 Jacob Jerrell @JacobJerrell - -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 . -*/ - -#include "bocaj.h" - -#ifdef KEYBOARD_planck_ez -userspace_config_t userspace_config; -#endif - -bool mod_key_press_timer(uint16_t code, uint16_t mod_code, bool pressed) { - static uint16_t this_timer; - if (pressed) { - this_timer = timer_read(); - } else { - if (timer_elapsed(this_timer) < TAPPING_TERM) { - tap_code(code); - } else { - register_code(mod_code); - tap_code(code); - unregister_code(mod_code); - } - } - return false; -} - -bool mod_key_press(uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer) { - if (pressed) { - this_timer = timer_read(); - } else { - if (timer_elapsed(this_timer) < TAPPING_TERM) { - tap_code(code); - } else { - register_code(mod_code); - tap_code(code); - unregister_code(mod_code); - } - } - return false; -} - -void bootmagic_lite(void) { - matrix_scan(); -#if defined(DEBOUNCING_DELAY) && DEBOUNCING_DELAY > 0 - wait_ms(DEBOUNCING_DELAY * 2); -#elif defined(DEBOUNCE) && DEBOUNCE > 0 - wait_ms(DEBOUNCE * 2); -#else - wait_ms(30); -#endif - matrix_scan(); - if (matrix_get_row(BOOTMAGIC_LITE_ROW) & (1 << BOOTMAGIC_LITE_COLUMN)) { - bootloader_jump(); - } -} - -__attribute__((weak)) void keyboard_pre_init_keymap(void) {} - -void keyboard_pre_init_user(void) { -#ifdef KEYBOARD_planck_ez - userspace_config.raw = eeconfig_read_user(); -#endif - keyboard_pre_init_keymap(); -} -// Add reconfigurable functions here, for keymap customization -// This allows for a global, userspace functions, and continued -// customization of the keymap. Use _keymap instead of _user -// functions in the keymaps -__attribute__((weak)) void matrix_init_keymap(void) {} - -// Call user matrix init, set default RGB colors and then -// call the keymap's init function -void matrix_init_user(void) { - matrix_init_keymap(); -} - -__attribute__((weak)) void keyboard_post_init_keymap(void) {} - -void keyboard_post_init_user(void) { -#if defined(RGB_MATRIX_ENABLE) - keyboard_post_init_rgb_matrix(); -#endif - keyboard_post_init_keymap(); -} - -__attribute__((weak)) void shutdown_keymap(void) {} - -void rgb_matrix_update_pwm_buffers(void); - -void shutdown_user(void) { -#ifdef RGB_MATRIX_ENABLE - rgb_matrix_set_color_all(0xFF, 0x00, 0x00); - rgb_matrix_update_pwm_buffers(); - -#endif // RGB_MATRIX_ENABLE - shutdown_keymap(); -} - -__attribute__((weak)) void suspend_power_down_keymap(void) {} - -void suspend_power_down_user(void) { suspend_power_down_keymap(); } - -__attribute__((weak)) void suspend_wakeup_init_keymap(void) {} - -void suspend_wakeup_init_user(void) { suspend_wakeup_init_keymap(); } - -__attribute__((weak)) void matrix_scan_secrets(void) {} -__attribute__((weak)) void matrix_scan_keymap(void) {} - -LEADER_EXTERNS(); - -// No global matrix scan code, so just run keymap's matrix -// scan function -void matrix_scan_user(void) { - static bool has_ran_yet; - if (!has_ran_yet) { - has_ran_yet = true; - startup_user(); - } - - LEADER_DICTIONARY() { - leading = false; - leader_end(); - - // Website Refresh / XCode "Run" - SEQ_ONE_KEY(KC_R) { - SEND_STRING(SS_LGUI("r")); - } - - SEQ_TWO_KEYS(KC_B, KC_D) { - SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION " Built at: " QMK_BUILDDATE); - } - - #ifndef NO_SECRETS - matrix_scan_secrets(); - #endif // !NO_SECRETS - } - -#if defined(RGB_MATRIX_ENABLE) - matrix_scan_rgb_matrix(); -#endif - - matrix_scan_keymap(); -} - -__attribute__((weak)) layer_state_t layer_state_set_keymap(layer_state_t state) { return state; } - -// on layer change, no matter where the change was initiated -// Then runs keymap's layer change check -layer_state_t layer_state_set_user(layer_state_t state) { - state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST); -#if defined(RGBLIGHT_ENABLE) - state = layer_state_set_rgb_light(state); -#endif // RGBLIGHT_ENABLE - return layer_state_set_keymap(state); -} - -__attribute__((weak)) layer_state_t default_layer_state_set_keymap(layer_state_t state) { return state; } - -// Runs state check and changes underglow color and animation -layer_state_t default_layer_state_set_user(layer_state_t state) { - state = default_layer_state_set_keymap(state); -#if 0 -# if defined(RGB_MATRIX_ENABLE) - state = default_layer_state_set_rgb(state); -# endif // RGB_MATRIX_ENABLE -#endif - return state; -} - -__attribute__((weak)) void led_set_keymap(uint8_t usb_led) {} - -// Any custom LED code goes here. -// So far, I only have keyboard specific code, -// So nothing goes here. -void led_set_user(uint8_t usb_led) { led_set_keymap(usb_led); } - -__attribute__((weak)) void eeconfig_init_keymap(void) {} - -void eeconfig_init_user(void) { -#ifdef KEYBOARD_planck_ez - userspace_config.raw = 0; -# if defined(RGB_MATRIX_ENABLE) - userspace_config.rgb_layer_change = true; -# endif - eeconfig_update_user(userspace_config.raw); -#endif - eeconfig_init_keymap(); - keyboard_init(); -} - -bool hasAllBitsInMask(uint8_t value, uint8_t mask) { - value &= 0xF; - mask &= 0xF; - - return (value & mask) == mask; -} diff --git a/users/bocaj/bocaj.h b/users/bocaj/bocaj.h deleted file mode 100644 index e69be74da5..0000000000 --- a/users/bocaj/bocaj.h +++ /dev/null @@ -1,73 +0,0 @@ -/* -Copyright 2017 Christopher Courtney @drashna -Copyright 2020 Jacob Jerrell @JacobJerrell - -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 . -*/ - -#pragma once -#include QMK_KEYBOARD_H - -#include "version.h" -#include "eeprom.h" -#include "process_records.h" -#include "wrappers.h" -#if defined(RGB_MATRIX_ENABLE) -# include "rgb_matrix_stuff.h" -#endif - -/* Define layer names */ -enum userspace_layers { - _WORKMAN = 0, - _QWERTY, - _WWORKMAN, - _WQWERTY, - _LOWER, - _RAISE, - _ADJUST, - _MOD, - LAYER_SAFE_RANGE, -}; - -#define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) -#define MODS_CTRL_MASK (MOD_BIT(KC_LCTL)|MOD_BIT(KC_RCTRL)) -#define MODS_ALT_MASK (MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT)) -#define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) - -bool mod_key_press_timer(uint16_t code, uint16_t mod_code, bool pressed); -bool mod_key_press(uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer); -void matrix_init_keymap(void); -void shutdown_keymap(void); -void suspend_power_down_keymap(void); -void suspend_wakeup_init_keymap(void); -void matrix_scan_keymap(void); -layer_state_t layer_state_set_keymap(layer_state_t state); -layer_state_t default_layer_state_set_keymap(layer_state_t state); -void led_set_keymap(uint8_t usb_led); -void eeconfig_init_keymap(void); -bool hasAllBitsInMask(uint8_t value, uint8_t mask); - -// clang-format off -#ifdef KEYBOARD_planck_ez -typedef union { - uint32_t raw; - struct { - bool rgb_layer_change :1; - bool rgb_matrix_idle_anim :1; - }; -} userspace_config_t; -// clang-format on - -extern userspace_config_t userspace_config; -#endif diff --git a/users/bocaj/config.h b/users/bocaj/config.h deleted file mode 100644 index 2a44aabfc4..0000000000 --- a/users/bocaj/config.h +++ /dev/null @@ -1,113 +0,0 @@ -#pragma once - -// Use custom magic number so that when switching branches, EEPROM always gets reset -#define EECONFIG_MAGIC_NUMBER (uint16_t)0x1339 - -/* Set Polling rate to 1000Hz */ -#define USB_POLLING_INTERVAL_MS 1 - -#ifdef AUDIO_ENABLE - -# define AUDIO_CLICKY -# define STARTUP_SONG SONG(RICK_ROLL) -# define GOODBYE_SONG SONG(SONIC_RING) -# define DEFAULT_LAYER_SONGS \ - { SONG(QWERTY_SOUND), SONG(COLEMAK_SOUND), SONG(DVORAK_SOUND), SONG(OVERWATCH_THEME) } - -# define AUDIO_CLICKY_FREQ_RANDOMNESS 1.5f - -# define UNICODE_SONG_MAC SONG(RICK_ROLL) -# define UNICODE_SONG_LNX SONG(RICK_ROLL) -# define UNICODE_SONG_WIN SONG(RICK_ROLL) -# define UNICODE_SONG_BSD SONG(RICK_ROLL) -# define UNICODE_SONG_WINC SONG(RICK_ROLL) -#endif // !AUDIO_ENABLE - -#ifdef RGB_MATRIX_ENABLE -# define RGB_MATRIX_KEYPRESSES // reacts to keypresses (will slow down matrix scan by a lot) -// # define RGB_MATRIX_KEYRELEASES // reacts to keyreleases (not recommened) -# define RGB_MATRIX_FRAMEBUFFER_EFFECTS -// # define RGB_DISABLE_AFTER_TIMEOUT 0 // number of ticks to wait until disabling effects -# define RGB_DISABLE_WHEN_USB_SUSPENDED true // turn off effects when suspended -// # define RGB_MATRIX_MAXIMUM_BRIGHTNESS 200 // limits maximum brightness of LEDs to 200 out of 255. If not defined maximum brightness is set to 255 -// # define EECONFIG_RGB_MATRIX (uint32_t *)16 - -# if defined(__AVR__) && !defined(__AVR_AT90USB1286__) -# define DISABLE_RGB_MATRIX_ALPHAS_MODS -# define DISABLE_RGB_MATRIX_GRADIENT_UP_DOWN -# define DISABLE_RGB_MATRIX_GRADIENT_LEFT_RIGHT -# define DISABLE_RGB_MATRIX_BREATHING -# define DISABLE_RGB_MATRIX_BAND_SAT -# define DISABLE_RGB_MATRIX_BAND_VAL -# define DISABLE_RGB_MATRIX_BAND_PINWHEEL_SAT -# define DISABLE_RGB_MATRIX_BAND_PINWHEEL_VAL -# define DISABLE_RGB_MATRIX_BAND_SPIRAL_SAT -# define DISABLE_RGB_MATRIX_BAND_SPIRAL_VAL -# define DISABLE_RGB_MATRIX_CYCLE_ALL -# define DISABLE_RGB_MATRIX_CYCLE_LEFT_RIGHT -# define DISABLE_RGB_MATRIX_CYCLE_UP_DOWN -# define DISABLE_RGB_MATRIX_CYCLE_OUT_IN -// # define DISABLE_RGB_MATRIX_CYCLE_OUT_IN_DUAL -# define DISABLE_RGB_MATRIX_RAINBOW_MOVING_CHEVRON -# define DISABLE_RGB_MATRIX_DUAL_BEACON -# define DISABLE_RGB_MATRIX_CYCLE_PINWHEEL -# define DISABLE_RGB_MATRIX_CYCLE_SPIRAL -# define DISABLE_RGB_MATRIX_RAINBOW_BEACON -# define DISABLE_RGB_MATRIX_RAINBOW_PINWHEELS -# define DISABLE_RGB_MATRIX_RAINDROPS -# define DISABLE_RGB_MATRIX_JELLYBEAN_RAINDROPS -// # define DISABLE_RGB_MATRIX_TYPING_HEATMAP -# define DISABLE_RGB_MATRIX_DIGITAL_RAIN -# define DISABLE_RGB_MATRIX_SOLID_REACTIVE -# define DISABLE_RGB_MATRIX_SOLID_REACTIVE_SIMPLE -# define DISABLE_RGB_MATRIX_SOLID_REACTIVE_WIDE -# define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTIWIDE -# define DISABLE_RGB_MATRIX_SOLID_REACTIVE_CROSS -# define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTICROSS -# define DISABLE_RGB_MATRIX_SOLID_REACTIVE_NEXUS -# define DISABLE_RGB_MATRIX_SOLID_REACTIVE_MULTINEXUS -# define DISABLE_RGB_MATRIX_SPLASH -# define DISABLE_RGB_MATRIX_MULTISPLASH -# define DISABLE_RGB_MATRIX_SOLID_SPLASH -# define DISABLE_RGB_MATRIX_SOLID_MULTISPLASH -# endif // AVR -#endif // RGB_MATRIX_ENABLE - -#ifdef QMK_KEYS_PER_SCAN -# undef QMK_KEYS_PER_SCAN -# define QMK_KEYS_PER_SCAN 1 -#endif // !QMK_KEYS_PER_SCAN - -// this makes it possible to do rolling combos (zx) with keys that -// convert to other keys on hold (z becomes ctrl when you hold it, -// and when this option isn't enabled, z rapidly followed by x -// actually sends Ctrl-x. That's bad.) -#define IGNORE_MOD_TAP_INTERRUPT -#undef PERMISSIVE_HOLD -//#define TAPPING_FORCE_HOLD -//#define RETRO_TAPPING - -#define FORCE_NKRO - -#ifndef TAPPING_TOGGLE -# define TAPPING_TOGGLE 1 -#endif - -#ifdef TAPPING_TERM -# undef TAPPING_TERM -#endif // TAPPING_TERM -#if defined(KEYBOARD_ergodox_ez) -# define TAPPING_TERM 185 -#else -# define TAPPING_TERM 175 -#endif - -#define TAP_CODE_DELAY 5 - -/* Disable unused and unneeded features to reduce on firmware size */ -#ifdef LOCKING_SUPPORT_ENABLE -# undef LOCKING_SUPPORT_ENABLE -#endif -#ifdef LOCKING_RESYNC_ENABLE -# undef LOCKING_RESYNC_ENABLE -#endif diff --git a/users/bocaj/process_records.c b/users/bocaj/process_records.c deleted file mode 100644 index 9eb181ad44..0000000000 --- a/users/bocaj/process_records.c +++ /dev/null @@ -1,111 +0,0 @@ -#include "bocaj.h" -#include - -__attribute__((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; } - -__attribute__((weak)) bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { return true; } - -// Defines actions tor my global custom keycodes. Defined in bocaj.h file -// Then runs the _keymap's record handler if not processed here -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - - if (process_record_keymap(keycode, record) && process_record_secrets(keycode, record) -#ifdef RGB_MATRIX_ENABLE - && process_record_user_rgb_matrix(keycode, record) -#endif - ) { - switch (keycode) { - case KC_WORKMAN: - if (!record->event.pressed) { - uint8_t mods = mod_config(get_mods()); - if (!mods) { - set_single_persistent_default_layer(_WORKMAN); - - } else if (mods & (MODS_GUI_MASK | MODS_CTRL_MASK)) { - set_single_persistent_default_layer(_WWORKMAN); - } - } - return false; - break; - case KC_QWERTY: - if (!record->event.pressed) { - uint8_t mods = mod_config(get_mods()); - if (!mods) { - set_single_persistent_default_layer(_QWERTY); - } else if (mods & (MODS_GUI_MASK | MODS_CTRL_MASK)) { - set_single_persistent_default_layer(_WQWERTY); - } - } - return false; - break; - - case MC_ARRW: - if (!record->event.pressed) { - clear_mods(); - send_string_with_delay_P(PSTR("->"), TAP_CODE_DELAY); - } - return false; - break; - - case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader - if (!record->event.pressed) { - clear_mods(); - send_string_with_delay_P(PSTR("qmk compile "), TAP_CODE_DELAY); - send_string_with_delay_P(PSTR("-kb " QMK_KEYBOARD), TAP_CODE_DELAY); - send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), TAP_CODE_DELAY); - } - return false; - break; - - case VRSN: // Prints firmware version - if (!record->event.pressed) { - send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE), TAP_CODE_DELAY); - } - break; -#if defined(RGB_MATRIX_ENABLE) - case KC_RGB_T: // This allows me to use underglow as layer indication, or as normal - if (!record->event.pressed) { - userspace_config.rgb_layer_change ^= 1; - dprintf("rgblight layer change [EEPROM]: %u\n", userspace_config.rgb_layer_change); - eeconfig_update_user(userspace_config.raw); - if (userspace_config.rgb_layer_change) { - rgblight_enable_noeeprom(); - layer_state_set(layer_state); // This is needed to immediately set the layer color (looks better) - } else { - rgblight_disable_noeeprom(); - } - } - return false; - break; - case RGB_TOG: - if (!record->event.pressed) { -# if defined(RGB_MATRIX_ENABLE) && !defined(RGB_MATRIX_DISABLE_KEYCODES) - rgb_matrix_toggle(); -# endif - } - return false; - break; - case RGB_MODE_FORWARD ... RGB_MODE_GRADIENT: // quantum_keycodes.h L400 for definitions - if (!record->event.pressed) { - bool is_eeprom_updated; -# if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) - if (userspace_config.rgb_matrix_idle_anim) { - userspace_config.rgb_matrix_idle_anim = false; - dprintf("RGB Matrix Idle Animation [EEPROM]: %u\n", userspace_config.rgb_matrix_idle_anim); - is_eeprom_updated = true; - } -# endif - if (is_eeprom_updated) { - eeconfig_update_user(userspace_config.raw); - } - } - return false; - break; -#endif - } - } -#ifdef CONSOLE_ENABLE - uprintf("KL: kc: %u, col: %u, row: %u, pressed: %u\n", keycode, record->event.key.col, record->event.key.row, record->event.pressed); -#endif - return true; -} diff --git a/users/bocaj/process_records.h b/users/bocaj/process_records.h deleted file mode 100644 index c17e2ffdc1..0000000000 --- a/users/bocaj/process_records.h +++ /dev/null @@ -1,44 +0,0 @@ -#pragma once -#include "bocaj.h" - -#if defined(KEYMAP_SAFE_RANGE) -# define PLACEHOLDER_SAFE_RANGE KEYMAP_SAFE_RANGE -#else -# define PLACEHOLDER_SAFE_RANGE SAFE_RANGE -#endif - -enum userspace_custom_keycodes { - VRSN = PLACEHOLDER_SAFE_RANGE, // Prints QMK Firmware and board info - KC_WORKMAN, // Sets default layer to WORKMAN - KC_QWERTY, // Sets default layer to QWERTY - // KC_COLEMAK, // Sets default layer to COLEMAK - // KC_DVORAK, // Sets default layer to DVORAK - KC_MAKE, // Run keyboard's customized make command - KC_RGB_T, // Toggles RGB Layer Indication mode - RGB_IDL, // RGB Idling animations - MC_ARRW, // -> - UC_FLIP, // (ಠ痊ಠ)┻━┻ - UC_TABL, // ┬─┬ノ( º _ ºノ) - UC_SHRG, // ¯\_(ツ)_/¯ - UC_DISA, // ಠ_ಠ - NEW_SAFE_RANGE // use "NEWPLACEHOLDER for keymap specific codes -}; - -bool process_record_secrets(uint16_t keycode, keyrecord_t *record); -bool process_record_keymap(uint16_t keycode, keyrecord_t *record); - -#define QWERTY KC_QWERTY -#define WORKMAN KC_WORKMAN - -#define KC_ARRW MC_ARRW - -#define KC_RST RESET - -#define MO_MOD MO(_MOD) -#define ALT_APP ALT_T(KC_APP) -#define HYP_LBK ALL_T(KC_LBRACKET) -#define MEH_RBK MEH_T(KC_RBRACKET) -#define HYP_LPR ALL_T(KC_LPRN) -#define MEH_RPR MEH_T(KC_RPRN) - -#define MG_NKRO MAGIC_TOGGLE_NKRO diff --git a/users/bocaj/readme.md b/users/bocaj/readme.md deleted file mode 100644 index 1206359675..0000000000 --- a/users/bocaj/readme.md +++ /dev/null @@ -1,5 +0,0 @@ -# Overview - -This is my personal userspace file. Most of my code exists here, as it's heavily shared. - -The template was taken from [Drashna's userspace](https://github.com/qmk/qmk_firmware/tree/master/users/drashna). There isn't much if anything in this userspace that warrants documentation he hasn't already covered. diff --git a/users/bocaj/rgb_matrix_stuff.c b/users/bocaj/rgb_matrix_stuff.c deleted file mode 100644 index bc50349d23..0000000000 --- a/users/bocaj/rgb_matrix_stuff.c +++ /dev/null @@ -1,106 +0,0 @@ -#include "bocaj.h" - -#include "lib/lib8tion/lib8tion.h" -extern led_config_t g_led_config; - -static uint32_t hypno_timer; -#if defined(SPLIT_KEYBOARD) || defined(KEYBOARD_ergodox_ez) || defined(KEYBOARD_crkbd) -# define RGB_MATRIX_REST_MODE RGB_MATRIX_CYCLE_OUT_IN_DUAL -#else -# define RGB_MATRIX_REST_MODE RGB_MATRIX_CYCLE_OUT_IN -#endif - -void rgb_matrix_set_color_row(uint8_t row, uint8_t red, uint8_t green, uint8_t blue) { -#ifdef KEYBOARD_planck_ez - if (row > 2) { - row = 0; - } - uint8_t row_multiplier = row * 12; - - rgb_matrix_set_color(1 + row_multiplier, red, green, blue); - rgb_matrix_set_color(2 + row_multiplier, red, green, blue); - rgb_matrix_set_color(3 + row_multiplier, red, green, blue); - rgb_matrix_set_color(4 + row_multiplier, red, green, blue); - rgb_matrix_set_color(5 + row_multiplier, red, green, blue); - rgb_matrix_set_color(6 + row_multiplier, red, green, blue); - rgb_matrix_set_color(7 + row_multiplier, red, green, blue); - rgb_matrix_set_color(8 + row_multiplier, red, green, blue); - rgb_matrix_set_color(9 + row_multiplier, red, green, blue); - rgb_matrix_set_color(10 + row_multiplier, red, green, blue); -#endif -} - -void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode, uint8_t speed, uint8_t led_type) { - HSV hsv = {hue, sat, val}; - if (hsv.v > rgb_matrix_get_val()) { - hsv.v = rgb_matrix_get_val(); - } - - switch (mode) { - case 1: // breathing - { - uint16_t time = scale16by8(g_rgb_timer, speed / 8); - hsv.v = scale8(abs8(sin8(time) - 128) * 2, hsv.v); - RGB rgb = hsv_to_rgb(hsv); - for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) { - if (HAS_FLAGS(g_led_config.flags[i], led_type)) { - rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); - } - } - break; - } - default: // Solid Color - { - RGB rgb = hsv_to_rgb(hsv); - for (uint8_t i = 0; i < DRIVER_LED_TOTAL; i++) { - if (HAS_FLAGS(g_led_config.flags[i], led_type)) { - rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); - } - } - break; - } - } -} - -__attribute__((weak)) void rgb_matrix_indicator_keymap(void) {} - -void matrix_scan_rgb_matrix(void) { -#if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) - if (userspace_config.rgb_matrix_idle_anim && rgb_matrix_get_mode() == RGB_MATRIX_TYPING_HEATMAP && timer_elapsed32(hypno_timer) > 15000) { - rgb_matrix_mode_noeeprom(RGB_MATRIX_REST_MODE); - } -#endif - rgb_matrix_indicator_keymap(); -} - -void keyboard_post_init_rgb_matrix(void) { -#if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) - if (userspace_config.rgb_matrix_idle_anim) { - rgb_matrix_mode_noeeprom(RGB_MATRIX_REST_MODE); - } -#endif -} - -bool process_record_user_rgb_matrix(uint16_t keycode, keyrecord_t *record) { -#if defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) - hypno_timer = timer_read32(); - if (userspace_config.rgb_matrix_idle_anim && rgb_matrix_get_mode() == RGB_MATRIX_REST_MODE) { - rgb_matrix_mode_noeeprom(RGB_MATRIX_TYPING_HEATMAP); - } -#endif - switch (keycode) { - case RGB_IDL: -#if defined(RGB_MATRIX_ENABLE) && defined(RGB_MATRIX_FRAMEBUFFER_EFFECTS) - if (record->event.pressed) { - userspace_config.rgb_matrix_idle_anim ^= 1; - dprintf("RGB Matrix Idle Animation [EEPROM]: %u\n", userspace_config.rgb_matrix_idle_anim); - eeconfig_update_user(userspace_config.raw); - if (userspace_config.rgb_matrix_idle_anim) { - rgb_matrix_mode_noeeprom(RGB_MATRIX_TYPING_HEATMAP); - } - } -#endif - break; - } - return true; -} diff --git a/users/bocaj/rgb_matrix_stuff.h b/users/bocaj/rgb_matrix_stuff.h deleted file mode 100644 index e48add2186..0000000000 --- a/users/bocaj/rgb_matrix_stuff.h +++ /dev/null @@ -1,10 +0,0 @@ -#pragma once -#include "quantum.h" - -bool process_record_user_rgb_matrix(uint16_t keycode, keyrecord_t *record); -void keyboard_post_init_rgb_matrix(void); -void matrix_scan_rgb_matrix(void); - -void rgb_matrix_set_color_all(uint8_t red, uint8_t green, uint8_t blue); -void rgb_matrix_layer_helper(uint8_t hue, uint8_t sat, uint8_t val, uint8_t mode, uint8_t speed, uint8_t led_type); -void rgb_matrix_set_color_row(uint8_t row, uint8_t red, uint8_t green, uint8_t blue); diff --git a/users/bocaj/wrappers.h b/users/bocaj/wrappers.h deleted file mode 100644 index 0f18d346a3..0000000000 --- a/users/bocaj/wrappers.h +++ /dev/null @@ -1,193 +0,0 @@ -#pragma once -#include "bocaj.h" - -/* -Since our quirky block definitions are basically a list of comma separated -arguments, we need a wrapper in order for these definitions to be -expanded before being used as arguments to the LAYOUT_xxx macro. -*/ -#if (!defined(LAYOUT) && defined(KEYMAP)) -# define LAYOUT KEYMAP -#endif - -// clang-format off -#define WRAPPER_ergodox_pretty(...) LAYOUT_ergodox_pretty(__VA_ARGS__) -#define WRAPPER_ortho_4x12(...) LAYOUT_ortho_4x12(__VA_ARGS__) - -/* ---------- LEFT HAND ----------- ---------- RIGHT HAND ---------- */ -#define WRAPPER_ergodox_bocaj( \ - L00,L01,L02,L03,L04,L05,L06, R00,R01,R02,R03,R04,R05,R06, \ - L10,L11,L12,L13,L14,L15,L16, R10,R11,R12,R13,R14,R15,R16, \ - L20,L21,L22,L23,L24,L25, R21,R22,R23,R24,R25,R26, \ - L30,L31,L32,L33,L34,L35,L36, R30,R31,R32,R33,R34,R35,R36, \ - L40,L41,L42,L43,L44, R42,R43,R44,R45,R46, \ - L55,L56, R50,R51, \ - L54, R52, \ - L53,L52,L51, R55,R54,R53 ) \ - WRAPPER_ergodox_pretty( \ - L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ - L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ - L20, L21, SFT_T(L22), GUI_T(L23), ALT_T(L24), L25, R21, ALT_T(R22), GUI_T(R23), SFT_T(R24), R25, R26, \ - L30, CTL_T(L31), L32, L33, L34, L35, ALL_T(L36), MEH_T(R30), R31, R32, R33, R34, CTL_T(R35), R36, \ - L40, L41, L42, L43, L44, R42, R43, R44, R45, R46, \ - L55,L56, /* <- LHS/RHS -> */ R50,R51, \ - L54, /* <- LHS/RHS -> */ R52, \ - LT(_LOWER, L53),L52,L51, /* <- LHS/RHS -> */ R55,R54,LT(_RAISE, R53) \ -) - -#define WRAPPER_ergodox_bocaj_WIN( \ - L00,L01,L02,L03,L04,L05,L06, R00,R01,R02,R03,R04,R05,R06, \ - L10,L11,L12,L13,L14,L15,L16, R10,R11,R12,R13,R14,R15,R16, \ - L20,L21,L22,L23,L24,L25, R21,R22,R23,R24,R25,R26, \ - L30,L31,L32,L33,L34,L35,L36, R30,R31,R32,R33,R34,R35,R36, \ - L40,L41,L42,L43,L44, R42,R43,R44,R45,R46, \ - L55,L56, R50,R51, \ - L54, R52, \ - L53,L52,L51, R55,R54,R53 ) \ - WRAPPER_ergodox_pretty( \ - L00, L01, L02, L03, L04, L05, L06, R00, R01, R02, R03, R04, R05, R06, \ - L10, L11, L12, L13, L14, L15, L16, R10, R11, R12, R13, R14, R15, R16, \ - L20, L21, SFT_T(L22), CTL_T(L23), ALT_T(L24), L25, R21, ALT_T(R22), CTL_T(R23), SFT_T(R24), R25, R26, \ - L30, GUI_T(L31), L32, L33, L34, L35, ALL_T(L36), MEH_T(R30), R31, R32, R33, R34, GUI_T(R35), R36, \ - L40, L41, L42, L43, L44, R42, R43, R44, R45, R46, \ - L55,L56, /* <- LHS/RHS -> */ R50,R51, \ - L54, /* <- LHS/RHS -> */ R52, \ - LT(_LOWER, L53),L52,L51, /* <- LHS/RHS -> */ R55,R54,LT(_RAISE, R53) \ -) - -/* - Planck EZ Wrappers -*/ -#define WRAPPER_planck_bocaj( \ - K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, \ - K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, \ - K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ - K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C \ -)\ - WRAPPER_ortho_4x12( \ - K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, \ - K11, K12, SFT_T(K13), GUI_T(K14), ALT_T(K15), K16, K17, ALT_T(K18), GUI_T(K19), SFT_T(K1A), K1B, K1C, \ - K21, CTL_T(K22), K23, K24, K25, K26, K27, K28, K29, K2A, CTL_T(K2B), K2C, \ - K31, K32, K33, K34, LT(_LOWER, K35), K36, K37, LT(_RAISE, K38), K39, K3A, K3B, K3C ) - -#define WRAPPER_planck_bocaj_WIN( \ - K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, \ - K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, \ - K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ - K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C \ -)\ - WRAPPER_ortho_4x12( \ - K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, \ - K11, K12, SFT_T(K13), CTL_T(K14), ALT_T(K15), K16, K17, ALT_T(K18), CTL_T(K19), SFT_T(K1A), K1B, K1C, \ - K21, GUI_T(K22), K23, K24, K25, K26, K27, K28, K29, K2A, GUI_T(K2B), K2C, \ - K31, K32, K33, K34, LT(_LOWER, K35), K36, K37, LT(_RAISE, K38), K39, K3A, K3B, K3C ) - -#define WRAPPER_planck_bocaj_base( \ - K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ - K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ - K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \ -) \ - WRAPPER_planck_bocaj( \ - KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_MINS, \ - KC_TAB, K11, K12, K13, K14, ALL_T(K15), MEH_T(K16), K17, K18, K19, K1A, KC_QUOT, \ - KC_LSFT, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, _______, \ - _______, KC_LEAD, KC_UP, KC_LEFT, KC_BSPC, KC_SPC, KC_SPC, KC_ENTER, KC_RIGHT, KC_DOWN, QWERTY, WORKMAN \ - ) - -#define WRAPPER_planck_bocaj_base_WIN( \ - K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, \ - K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, \ - K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A \ -) \ - WRAPPER_planck_bocaj_WIN( \ - KC_ESC, K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, KC_MINS, \ - KC_TAB, K11, K12, K13, K14, ALL_T(K15), MEH_T(K16), K17, K18, K19, K1A, KC_QUOT, \ - KC_LSFT, K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, _______, \ - _______, KC_LEAD, KC_UP, KC_LEFT, KC_BSPC, KC_SPC, KC_SPC, KC_ENTER, KC_RIGHT, KC_DOWN, QWERTY, WORKMAN \ - ) - -/* -Blocks for each of the four major keyboard layouts -Organized so we can quickly adapt and modify all of them -at once, rather than for each keyboard, one at a time. -And this allows for much cleaner blocks in the keymaps. -For instance Tap/Hold for Control on all of the layouts - -NOTE: These are all the same length. If you do a search/replace - then you need to add/remove underscores to keep the - lengths consistent. -*/ - -#define _________________QWERTY_L1_________________ KC_Q, KC_W, KC_E, KC_R, KC_T -#define _________________QWERTY_L2_________________ KC_A, KC_S, KC_D, KC_F, KC_G -#define _________________QWERTY_L3_________________ KC_Z, KC_X, KC_C, KC_V, KC_B - -#define _________________QWERTY_R1_________________ KC_Y, KC_U, KC_I, KC_O, KC_P -#define _________________QWERTY_R2_________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN -#define _________________QWERTY_R3_________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLASH - -#define _________________COLEMAK_L1________________ KC_Q, KC_W, KC_F, KC_P, KC_G -#define _________________COLEMAK_L2________________ KC_A, KC_R, KC_S, KC_T, KC_D -#define _________________COLEMAK_L3________________ KC_Z, KC_X, KC_C, KC_V, KC_B - -#define _________________COLEMAK_R1________________ KC_J, KC_L, KC_U, KC_Y, KC_SCLN -#define _________________COLEMAK_R2________________ KC_H, KC_N, KC_E, KC_I, KC_O -#define _________________COLEMAK_R3________________ KC_K, KC_M, KC_COMM, KC_DOT, KC_SLASH - -#define _________________DVORAK_L1_________________ KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y -#define _________________DVORAK_L2_________________ KC_A, KC_O, KC_E, KC_U, KC_I -#define _________________DVORAK_L3_________________ KC_SCLN, KC_Q, KC_J, KC_K, KC_X - -#define _________________DVORAK_R1_________________ KC_F, KC_G, KC_C, KC_R, KC_L -#define _________________DVORAK_R2_________________ KC_D, KC_H, KC_T, KC_N, KC_S -#define _________________DVORAK_R3_________________ KC_B, KC_M, KC_W, KC_V, KC_Z - -#define _________________WORKMAN_L1________________ KC_Q, KC_D, KC_R, KC_W, KC_B -#define _________________WORKMAN_L2________________ KC_A, KC_S, KC_H, KC_T, KC_G -#define _________________WORKMAN_L3________________ KC_Z, KC_X, KC_M, KC_C, KC_V - -#define _________________WORKMAN_R1________________ KC_J, KC_F, KC_U, KC_P, KC_SCLN -#define _________________WORKMAN_R2________________ KC_Y, KC_N, KC_E, KC_O, KC_I -#define _________________WORKMAN_R3________________ KC_K, KC_L, KC_COMM, KC_DOT, KC_SLASH - -#define ________________NUMBER_LEFT________________ KC_1, KC_2, KC_3, KC_4, KC_5 -#define ________________NUMBER_RIGHT_______________ KC_6, KC_7, KC_8, KC_9, KC_0 -#define _________________FUNC_LEFT_________________ KC_F1, KC_F2, KC_F3, KC_F4, KC_F5 -#define _________________FUNC_RIGHT________________ KC_F6, KC_F7, KC_F8, KC_F9, KC_F10 - -#define ___________________BLANK___________________ _______, _______, _______, _______, _______ -#define _________________UNDEFINED_________________ XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX - -#define ___________________LOWER_L1_EXT____________________ KC_GRV, _______, _______, KC_UP, _______, KC_ARRW -#define ___________________LOWER_L2_EXT____________________ KC_DEL, _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_LPRN -#define ___________________LOWER_L3_EXT____________________ _______, _______, _______, _______, _______, KC_LBRC - -#define ___________________LOWER_R1_EXT____________________ KC_MINS, KC_7, KC_8, KC_9, KC_PLUS, KC_EQUAL -#define ___________________LOWER_R2_EXT____________________ KC_RPRN, KC_4, KC_5, KC_6, KC_ASTR, KC_BSLS -#define ___________________LOWER_R3_EXT____________________ KC_RBRC, KC_1, KC_2, KC_3, KC_SLSH, _______ - -// #define _________________LOWER_L1__________________ ________________NUMBER_LEFT________________ -// #define _________________LOWER_L2__________________ _______, _______, _______, _______, KC_LPRN -// #define _________________LOWER_L3__________________ _______, _______, _______, KC_ARRW, KC_LBRC - -// #define _________________LOWER_R1__________________ ________________NUMBER_RIGHT_______________ -// #define _________________LOWER_R2__________________ KC_RPRN, _______, _______, _______, _______ -// #define _________________LOWER_R3__________________ KC_RBRC, _______, _______, _______, _______ - -#define _________________RAISE_L1__________________ KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC -#define _________________RAISE_L2__________________ _________________FUNC_LEFT_________________ -#define _________________RAISE_L3__________________ ___________________BLANK___________________ - -#define _________________RAISE_R1__________________ KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN -#define _________________RAISE_R2__________________ _________________FUNC_RIGHT________________ -#define _________________RAISE_R3__________________ ___________________BLANK___________________ - -#define _________________ADJUST_L1_________________ RGB_MOD, RGB_HUI, RGB_SAI, RGB_VAI, RGB_TOG -#define _________________ADJUST_L2_________________ KC__MUTE, KC__VOLDOWN, KC__VOLUP, _______, KC_MNXT -#define _________________ADJUST_L3_________________ RGB_RMOD, RGB_HUD, RGB_SAD, RGB_VAD, KC_RGB_T - -#define _________________ADJUST_R1_________________ ___________________BLANK___________________ -#define _________________ADJUST_R2_________________ CG_SWAP, WORKMAN, QWERTY, _______, _______ -#define _________________ADJUST_R3_________________ MU_TOG , CK_TOGG, AU_ON, AU_OFF, CG_NORM - -// clang-format on diff --git a/users/jjerrell/.gitignore b/users/jjerrell/.gitignore new file mode 100644 index 0000000000..1753bf931b --- /dev/null +++ b/users/jjerrell/.gitignore @@ -0,0 +1 @@ +secrets.* diff --git a/users/jjerrell/config.h b/users/jjerrell/config.h new file mode 100644 index 0000000000..bddafe1557 --- /dev/null +++ b/users/jjerrell/config.h @@ -0,0 +1,26 @@ +// Copyright (C) 2021 Jerrell, Jacob <@jjerrell> +// +// This file is part of jjerrell. +// +// jjerrell 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 3 of the License, or +// (at your option) any later version. +// +// jjerrell 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 jjerrell. If not, see . + +#pragma once + +#define LEADER_TIMEOUT 250 +#define LEADER_PER_KEY_TIMING + +#if defined(TAP_CODE_DELAY) +# undef TAP_CODE_DELAY +#endif +#define TAP_CODE_DELAY 20 diff --git a/users/jjerrell/jjerrell.c b/users/jjerrell/jjerrell.c new file mode 100644 index 0000000000..95c2acba5e --- /dev/null +++ b/users/jjerrell/jjerrell.c @@ -0,0 +1,138 @@ +/** + * Copyright (C) 2021 Jerrell, Jacob <@jjerrell> + * + * This file is part of qmk_firmware. + * + * qmk_firmware 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 3 of the License, or + * (at your option) any later version. + * + * qmk_firmware 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 qmk_firmware. If not, see . + */ + +#include "jjerrell.h" + +__attribute__((weak)) void matrix_scan_keymap(void) {} +__attribute__((weak)) void leader_scan_secrets(void) {} + +#ifdef LEADER_ENABLE + LEADER_EXTERNS(); + void matrix_scan_leader(void) { + static uint8_t mods = 0; + mods = get_mods(); + LEADER_DICTIONARY() { + leading = false; + leader_end(); + clear_mods(); + + // Website Refresh / XCode "Run" + SEQ_ONE_KEY(KC_R) { + SEND_STRING(SS_LGUI("r")); + } + + SEQ_TWO_KEYS(KC_B, KC_D) { + send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION " Built at: " QMK_BUILDDATE), TAP_CODE_DELAY); + } + + SEQ_TWO_KEYS(KC_L, KC_C) { + send_string_with_delay("/** */", TAP_CODE_DELAY); + wait_ms(TAPPING_TERM); + tap_code(KC_LEFT); + tap_code(KC_LEFT); + tap_code(KC_LEFT); + if (!(mods & MOD_MASK_SHIFT)) { + tap_code(KC_ENT); + } + } + + set_mods(mods); + #ifndef NO_SECRETS + leader_scan_secrets(); + #endif // !NO_SECRETS + } + } +#endif + +static bool is_first_run = true; +void matrix_scan_user(void) { + if (is_first_run) { + is_first_run = false; + startup_user(); + } + #ifdef LEADER_ENABLE + matrix_scan_leader(); + #endif + matrix_scan_keymap(); +} + +__attribute__((weak)) layer_state_t layer_state_set_keymap(layer_state_t state) { return state; } + +// on layer change, no matter where the change was initiated +// Then runs keymap's layer change check +layer_state_t layer_state_set_user(layer_state_t state) { + if (!is_keyboard_master()) { + return state; + } + + state = update_tri_layer_state(state, _RAISE, _LOWER, _ADJUST); + state = layer_state_set_keymap(state); +#if defined(RGBLIGHT_ENABLE) + state = layer_state_set_rgb_light(state); +#endif // RGBLIGHT_ENABLE + return state; +} + +__attribute__((weak)) void dip_switch_update_keymap(uint8_t index, bool active) {} +void dip_switch_update_user(uint8_t index, bool active) { + dip_switch_update_keymap(index, active); +} + +__attribute__((weak)) bool music_mask_keymap(uint16_t keycode) { return true; } +bool music_mask_user(uint16_t keycode) { + switch (keycode){ + default: + return music_mask_keymap(keycode); + break; + } +} + +__attribute__((weak)) layer_state_t default_layer_state_set_keymap(layer_state_t state) { return state; } + +// Runs state check and changes underglow color and animation +layer_state_t default_layer_state_set_user(layer_state_t state) { + if (!is_keyboard_master()) { + return state; + } + return default_layer_state_set_keymap(state); +} + +#ifdef AUDIO_ENABLE +__attribute__((weak)) void startup_keymap(void) {} +void startup_user(void) +{ + wait_ms(TAP_CODE_DELAY); // gets rid of tick + startup_keymap(); +} + +__attribute__((weak)) void shutdown_keymap(void) {} +void shutdown_user(void) +{ + wait_ms(TAP_CODE_DELAY); + stop_all_notes(); + shutdown_keymap(); +} + +__attribute__((weak)) void music_on_keymap(void) {} +void music_on_user(void) +{ + music_scale_user(); + music_on_keymap(); +} +#endif // AUDIO_ENABLE diff --git a/users/jjerrell/jjerrell.h b/users/jjerrell/jjerrell.h new file mode 100644 index 0000000000..92b95ccc01 --- /dev/null +++ b/users/jjerrell/jjerrell.h @@ -0,0 +1,53 @@ +/** + * Copyright (C) 2021 Jerrell, Jacob <@jjerrell> + * + * This file is part of qmk_firmware. + * + * qmk_firmware 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 3 of the License, or + * (at your option) any later version. + * + * qmk_firmware 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 qmk_firmware. If not, see . + */ + +#pragma once +#include QMK_KEYBOARD_H + +/** QMK Includes **/ +#include "version.h" +#include "eeprom.h" +#include "muse.h" + +#include "process_records.h" +#include "wrappers.h" + +/************************* Userspace Layers ************************* + * Keymaps can define additional layers by making the first case + * equal to `LAYER_SAFE_RANGE` + ********************************************************************/ +enum userspace_layers { + _WORKMAN, + _QWERTY, + _LOWER, + _RAISE, + _ADJUST, + _SPECIAL, + _GAME, + LAYER_SAFE_RANGE, +}; + +void matrix_scan_keymap(void); +layer_state_t layer_state_set_keymap(layer_state_t state); +void dip_switch_update_keymap(uint8_t index, bool active); +bool music_mask_keymap(uint16_t keycode); +layer_state_t default_layer_state_set_keymap(layer_state_t state); +void startup_keymap(void); +void shutdown_keymap(void); +void music_on_keymap(void); diff --git a/users/jjerrell/process_records.c b/users/jjerrell/process_records.c new file mode 100644 index 0000000000..abdcd0934c --- /dev/null +++ b/users/jjerrell/process_records.c @@ -0,0 +1,139 @@ +/** + * Copyright (C) 2021 Jerrell, Jacob <@jjerrell> + * + * This file is part of qmk_firmware. + * + * qmk_firmware 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 3 of the License, or + * (at your option) any later version. + * + * qmk_firmware 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 qmk_firmware. If not, see . + */ + +#include "jjerrell.h" + +float game_song[][2] = SONG(TO_BOLDLY_GO); +float work_song[][2] = SONG(MARIO_GAMEOVER); +float doom_song[][2] = SONG(E1M1_DOOM); + +__attribute__((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; } + +static uint16_t key_timer; + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + if (process_record_keymap(keycode, record)) { + static uint8_t mods = 0; + // static uint8_t layer = 0; + mods = get_mods(); + switch (keycode) { + case KC_QWERTY: + if (record->event.pressed) { + set_single_persistent_default_layer(_QWERTY); + } + return false; + break; + case KC_WORKMAN: + if (record->event.pressed) { + set_single_persistent_default_layer(_WORKMAN); + } + return false; + break; + case KC_CCCV: + if (record->event.pressed) { + key_timer = timer_read(); + } else { + clear_mods(); + if (timer_elapsed(key_timer) > TAPPING_TERM) { // Hold, copy + tap_code16(G(KC_C)); + } else if (mods & MOD_MASK_SHIFT) { + // Tap w/ shift held, open [Paste App](https://pasteapp.io) (no affiliation) + // Shift + Command(GUI) + V + tap_code16(S(G(KC_V))); + } else { // Regular tap, do paste + tap_code16(G(KC_V)); + } + set_mods(mods); + } + return false; + break; + case KC_ARROW: + if (record->event.pressed) { + clear_mods(); + if (mods & MOD_MASK_SHIFT) { + SEND_STRING("=>"); + } else { + SEND_STRING("->"); + } + set_mods(mods); + } + return false; + break; + case KC_MAKE: + if (!record->event.pressed) { +#ifndef MAKE_BOOTLOADER + uint8_t temp_mod = mod_config(get_mods()); + uint8_t temp_osm = mod_config(get_oneshot_mods()); + clear_mods(); + clear_oneshot_mods(); +#endif + send_string_with_delay_P(PSTR("qmk"), TAP_CODE_DELAY); +#ifndef MAKE_BOOTLOADER + if ((temp_mod | temp_osm) & MOD_MASK_SHIFT) +#endif + { + send_string_with_delay_P(PSTR(" flash "), TAP_CODE_DELAY); +#ifndef MAKE_BOOTLOADER + } else { + send_string_with_delay_P(PSTR(" compile "), TAP_CODE_DELAY); +#endif + } + send_string_with_delay_P(PSTR("-kb " QMK_KEYBOARD " -km " QMK_KEYMAP), TAP_CODE_DELAY); + send_string_with_delay_P(PSTR(SS_TAP(X_ENTER)), TAP_CODE_DELAY); + } + return false; + break; + case KC_VRSN: + if (!record->event.pressed) { + send_string_with_delay_P(PSTR(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION " Built at: " QMK_BUILDDATE), TAP_CODE_DELAY); + } + return false; + break; + case KC_GAME: + if (record->event.pressed) { + key_timer = timer_read(); + } else { + if (IS_LAYER_OFF(_GAME)) { + if (timer_elapsed(key_timer) > TAPPING_TERM) { + layer_move(_GAME); +#ifdef AUDIO_ENABLE +PLAY_SONG(game_song); +#endif + } + break; + // todo: cycle game layers + // } else if (mods & MOD_MASK_SHIFT) { +// #ifdef AUDIO_ENABLE +// PLAY_SONG(doom_song); +// #endif +// break; + } else { + layer_move(_WORKMAN); +#ifdef AUDIO_ENABLE +PLAY_SONG(work_song); +#endif + break; + } + } + return false; + break; + } + } + return true; +} diff --git a/users/jjerrell/process_records.h b/users/jjerrell/process_records.h new file mode 100644 index 0000000000..de37421b10 --- /dev/null +++ b/users/jjerrell/process_records.h @@ -0,0 +1,41 @@ +// Copyright (C) 2021 Jerrell, Jacob <@jjerrell> +// +// This file is part of qmk_firmware. +// +// qmk_firmware 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 3 of the License, or +// (at your option) any later version. +// +// qmk_firmware 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 qmk_firmware. If not, see . + +#pragma once +#include "jjerrell.h" + +#if defined(KEYMAP_SAFE_RANGE) +# define PLACEHOLDER_SAFE_RANGE KEYMAP_SAFE_RANGE +#else +# define PLACEHOLDER_SAFE_RANGE SAFE_RANGE +#endif + +enum userspace_keycodes { + KC_ARROW = PLACEHOLDER_SAFE_RANGE, // `->` + KC_MAKE, // Runs the keyboard's make command + KC_QWERTY, // Default Layer -> QWERTY + KC_WORKMAN, // Default Layer -> Workman + KC_VRSN, // Print QMK Firmware and board info + RGB_IDL, // Toggle RGB Idle animations + RGB_TGL, // Toggle RGB Layer Indication + KC_CCCV, // One key copy/paste, + KC_GAME, // To game layer. If on game layer, cycle game layers + NEW_SAFE_RANGE // use NEW_SAFE_RANGE for keymap specific codes +}; + +bool process_record_keymap(uint16_t keycode, keyrecord_t *record); + diff --git a/users/jjerrell/readme.md b/users/jjerrell/readme.md new file mode 100644 index 0000000000..a382524f2e --- /dev/null +++ b/users/jjerrell/readme.md @@ -0,0 +1,50 @@ + + +# JJerrell's QMK Userspace + +This userspace showcases my personal journey with QMK keyboards and aims to simplify additional development, reduce code duplication, and maintain a consistent experience across my current keyboards. My original userspace has been archived because I wanted to take the time to grasp _how_ what I was doing worked -- rather than copy/pasta and blind luck. + +Some keyboard specific code is stored here because it's contextually relevant. It may be somewhat pedantic, but an effort has been made to wrap this code with preprocessor checks. i.e. `#if (defined(KEYBOARD_planck_ez))`. + +## Daily Drivers + +1. Ergodox EZ - My first mechanical love. Now the office keyboard (if we go back). After finding inferior travel cases for exorbitant amounts of money, I built a custom travel case out of a case designed for drones and maticulous work cutting guncase foam. Around $50 with plenty of foam left over for family LARPing weapons. I'll post a picture one of these days. It also has a spot for my wireless touchpad. +2. Planck EZ - The solution to not being able to sit at a desk 100% of the time and not being able to live without QMK for any amount of time. Karabiner-Elements disables the Macbook keyboard when this is plugged in and the planck sits ontop of it with a very short usb-c cable. Probably terrible for the built in keyboard but they screwed up this generation anyway. +3. Moonlander - Just when I thought it was over, the lovely people with ZSA did it again. This one stays at home on my desk. + +## Features + +- Keymap level customization + - User methods implemented here will give the keymaps a chance to override functionality by optionally implementing relevant _keymap methods +- Layer Macros + - WRAPPER defines in [wrapper.c] simplify consistent keymaps +- Leader key secrets + - [jjerrell.c] sets up the functionality for this feature and calls into the leader_scan_secrets method. + - TODO: add documentation for leader_scan_secrets implementation + +## Issues + +### Tap/hold keys and shifted keycodes + +An immediate part of my love for QMK was it's ability to differentiate between holds and presses to a level where you can apply modifiers when a normal alpha code is held. This feature was the single-most health related improvement to adopting QMK, in my opinion. + +Beloved as it may be it comes with some baggage; shifted keycodes will be applied as their unshifted counterparts. I've worked around this in the past but the solution this time is a close adoption of the symbol layer inspired by the Neo keyboard. + +There is also a problem with relying on SFT_T() for all of your shifting needs because if you attempt to swap which fingers are holding it and don't release the first before pressing the second, shift won't register anymore. This could probably be fixed but it discourages typing in all caps because it becomes too tedious. However, most layers do have a dedicated shift key to counteract this when necessary. diff --git a/users/bocaj/rules.mk b/users/jjerrell/rules.mk similarity index 73% rename from users/bocaj/rules.mk rename to users/jjerrell/rules.mk index a0e7e93bc1..db359a5757 100644 --- a/users/bocaj/rules.mk +++ b/users/jjerrell/rules.mk @@ -1,4 +1,4 @@ -SRC += bocaj.c \ +SRC += jjerrell.c \ process_records.c LEADER_ENABLE = yes @@ -20,7 +20,8 @@ ifneq ($(strip $(NO_SECRETS)), yes) endif endif -RGB_MATRIX_ENABLE ?= no -ifneq ($(strip $(RGB_MATRIX_ENABLE)), no) - SRC += rgb_matrix_stuff.c -endif +# TODO: RGB is next +# RGB_MATRIX_ENABLE ?= no +# ifneq ($(strip $(RGB_MATRIX_ENABLE)), no) +# SRC += rgb_matrix_stuff.c +# endif diff --git a/users/jjerrell/wrappers.h b/users/jjerrell/wrappers.h new file mode 100644 index 0000000000..cc0f963e8d --- /dev/null +++ b/users/jjerrell/wrappers.h @@ -0,0 +1,329 @@ +// Copyright (C) 2021 Jerrell, Jacob <@jjerrell> +// +// This file is part of qmk_firmware. +// +// qmk_firmware 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 3 of the License, or +// (at your option) any later version. +// +// qmk_firmware 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 qmk_firmware. If not, see . + +#pragma once +#include "jjerrell.h" + +#define QWERTY KC_QWERTY +#define WORKMN KC_WORKMAN + +#define KC_CUT LGUI(KC_X) + +// Non-sane shortcuts for software macros or keybindings +#define MACRO_1 ALL_T(KC_F12) +#define MACRO_2 ALL_T(KC_F13) +#define MACRO_3 ALL_T(KC_F14) +#define MACRO_4 ALL_T(KC_F15) + +#define MACRO_5 ALL_T(KC_F16) +#define MACRO_6 ALL_T(KC_F17) +#define MACRO_7 ALL_T(KC_F18) +#define MACRO_8 ALL_T(KC_F19) + +// clang-format off +#if (!defined(LAYOUT) && defined(KEYMAP)) +# define LAYOUT KEYMAP +#endif + +#if (defined(KEYBOARD_planck_ez)) +/** Planck EZ Empty + * ,-----------------------------------------------------------------------------------. + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | | + * |------+------+------+------+------+------+------+------+------+------+------+------| + * | | | | | | | | | | | | + * `-----------------------------------------------------------------------------------' + */ + +# define ____________________________________________________________PLANCK_VERBOSE_BOTTOM_ROW_____________________________________________________________ \ + KC_LEAD, KC_LSFT, KC_CCCV, KC_HYPR, LT(_LOWER, KC_BSPC), SFT_T(KC_SPC), XXXXXXX, LT(_RAISE, KC_ENT), KC_MEH, RGB_TOG, RGB_IDL, LED_LEVEL + +# define _________________________________________PLANCK_LOWER_BOTTOM_ROW_________________________________________ \ + KC_LEAD, KC_LSFT, KC_CCCV, KC_HYPR, KC_BSPC, KC_SPC, XXXXXXX, KC_ENT, KC_0, KC_DOT, KC_COMM, LED_LEVEL +// TODO: It would be nice to find a way to apply the bottom row with optional left/right varargs. +// I'm completely unsure if this language can support something like that though. + +/** + * Basic Planck EZ Wrapper to expand "block" defines before sending + * to LAYOUT_ortho_4x12 + */ +# define WRAPPER_ortho_4x12(...) LAYOUT_ortho_4x12(__VA_ARGS__) + +# define WRAPPER_planck_common( \ + K01, K02, K03, K04, K05, K08, K09, K0A, K0B, K0C, \ + K11, K12, K13, K14, K15, K18, K19, K1A, K1B, K1C, \ + K21, K22, K23, K24, K25, K28, K29, K2A, K2B, K2C \ + ) WRAPPER_ortho_4x12( \ + K01, K02, K03, K04, K05 , XXXXXXX , XXXXXXX, K08, K09, K0A, K0B, K0C, \ + K11, K12, K13, K14, K15 , XXXXXXX , XXXXXXX, K18, K19, K1A, K1B, K1C, \ + K21, K22, K23, K24, K25 , XXXXXXX , XXXXXXX, K28, K29, K2A, K2B, K2C, \ + ____________________________________________________________PLANCK_VERBOSE_BOTTOM_ROW_____________________________________________________________ ) + +/** + * Shifted Key conflicts: + * K12, K13, K14, K19, K1A, K1B, K21, K2C + */ +# define WRAPPER_planck_base( \ + K01, K02, K03, K04, K05, K08, K09, K0A, K0B, K0C, \ + K11, K12, K13, K14, K15, K18, K19, K1A, K1B, K1C, \ + K21, K22, K23, K24, K25, K28, K29, K2A, K2B, K2C \ + ) WRAPPER_ortho_4x12( \ + K01 , K02 , K03 , K04 , K05 , KC_GAME , KC_GAME, K08, K09 , K0A , K0B , K0C, \ + K11 , SFT_T(K12), GUI_T(K13), ALT_T(K14), K15 , XXXXXXX , XXXXXXX, K18, ALT_T(K19), GUI_T(K1A), SFT_T(K1B), K1C, \ + CTL_T(K21), K22 , K23 , K24 , K25 , XXXXXXX , XXXXXXX, K28, K29 , K2A , K2B , CTL_T(K2C), \ + ____________________________________________________________PLANCK_VERBOSE_BOTTOM_ROW_____________________________________________________________ ) + +# define WRAPPER_planck_mods( \ + K01, K02, K03, K04, K05, K06, K07, K08, K09, K0A, K0B, K0C, \ + K11, K12, K13, K14, K15, K16, K17, K18, K19, K1A, K1B, K1C, \ + K21, K22, K23, K24, K25, K26, K27, K28, K29, K2A, K2B, K2C, \ + K31, K32, K33, K34, K35, K36, K37, K38, K39, K3A, K3B, K3C \ + ) WRAPPER_ortho_4x12( \ + K01 , K02 , K03 , K04 , K05 , K06 , K07, K08, K09 , K0A , K0B , K0C, \ + K11 , SFT_T(K12), GUI_T(K13), ALT_T(K14), K15 , K16 , K17, K18, ALT_T(K19), GUI_T(K1A), SFT_T(K1B), K1C, \ + CTL_T(K21), K22 , K23 , K24 , K25 , K26 , K27, K28, K29 , K2A , K2B , CTL_T(K2C), \ + K31, K32 , K33 , K34 , LT(_LOWER, K35), SFT_T(K36), XXXXXXX, LT(_RAISE, K38), K39 , K3A , K3B, K3C ) + + + +// These macros are used when defining layouts in keymap.c +# define LAYOUT_planck_base(...) WRAPPER_planck_base(__VA_ARGS__) +# define LAYOUT_planck_common(...) WRAPPER_planck_common(__VA_ARGS__) +# define LAYOUT_planck_mods(...) WRAPPER_planck_mods(__VA_ARGS__) + +#elif defined(KEYBOARD_moonlander) +/** Moonlander Empty + * ( \ + k00, k01, k02, k03, k04, k05, k06, k60, k61, k62, k63, k64, k65, k66, \ + k10, k11, k12, k13, k14, k15, k16, k70, k71, k72, k73, k74, k75, k76, \ + k20, k21, k22, k23, k24, k25, k26, k80, k81, k82, k83, k84, k85, k86, \ + k30, k31, k32, k33, k34, k35, k91, k92, k93, k94, k95, k96, \ + k40, k41, k42, k43, k44, k53, kb3, ka2, ka3, ka4, ka5, ka6, \ + k50, k51, k52, kb4, kb5, kb6 \ + ) \ + */ +# define WRAPPER_moonlander(...) LAYOUT_moonlander(__VA_ARGS__) +# define WRAPPER_moonlander_common( \ + k11, k12, k13, k14, k15, k71, k72, k73, k74, k75, \ + k21, k22, k23, k24, k25, k81, k82, k83, k84, k85, \ + k31, k32, k33, k34, k35, k91, k92, k93, k94, k95, \ + k41, k42, k43, k44, ka2, ka3, ka4, ka5 \ + ) WRAPPER_moonlander( \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, k11, k12, k13, k14, k15, XXXXXXX, XXXXXXX, k71, k72, k73, k74, k75, XXXXXXX, \ + XXXXXXX, k21, k22, k23, k24, k25, XXXXXXX, XXXXXXX, k81, k82, k83, k84, k85, XXXXXXX, \ + KC_LSFT, k31, k32, k33, k34, k35, k91, k92, k93, k94, k95, KC_RSFT, \ + MO(_SPECIAL), k41, k42, k43, k44, TO(_GAME), XXXXXXX, ka2, ka3, ka4, ka5, MO(_SPECIAL), \ + LT(_LOWER, KC_SPC),HYPR_T(KC_BSPC),KC_LEAD, KC_CCCV,SFT_T(KC_TAB),LT(_RAISE, KC_ENT) ) + +# define WRAPPER_moonlander_mods( \ + k11, k12, k13, k14, k15, k71, k72, k73, k74, k75, \ + k21, k22, k23, k24, k25, k81, k82, k83, k84, k85, \ + k31, k32, k33, k34, k35, k91, k92, k93, k94, k95, \ + k41, k42, k43, k44, ka2, ka3, ka4, ka5 \ + ) WRAPPER_moonlander_common( \ + k11 , k12 , k13 , k14 , k15, k71, k72, k73, k74, k75, \ + k21 , SFT_T(k22), GUI_T(k23), ALT_T(k24), k25, k81, ALT_T(k82), GUI_T(k83), SFT_T(k84), k85, \ + CTL_T(k31), k32 , k33 , k34 , k35, k91, k92, k93, k94, CTL_T(k95), \ + k41 , k42 , k43 , k44 , ka2, ka3, ka4, ka5 \ + ) +# define WRAPPER_moonlander_gamepad( \ + k00, k01, k02, k03, k04, k05, k06, \ + k10, k11, k12, k13, k14, k15, k16, \ + k20, k21, k22, k23, k24, k25, k26, \ + k30, k31, k32, k33, k34, k35, \ + k40, k41, k42, k43, k44, k53, \ + k50, k51, k52 \ + ) WRAPPER_moonlander( \ + k00, k01, k02, k03, k04, k05, k06, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + k10, k11, k12, k13, k14, k15, k16, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + k20, k21, k22, k23, k24, k25, k26, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + k30, k31, k32, k33, k34, k35, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + k40, k41, k42, k43, k44, k53, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + k50, k51, k52, XXXXXXX, XXXXXXX, TO(_WORKMAN) \ + ) + +# define LAYOUT_moonlander_common(...) WRAPPER_moonlander_common(__VA_ARGS__) +# define LAYOUT_moonlander_mods(...) WRAPPER_moonlander_mods(__VA_ARGS__) +# define LAYOUT_moonlander_gamepad(...) WRAPPER_moonlander_gamepad(__VA_ARGS__) +#elif defined(KEYBOARD_ergodox_ez) +/** Ergodox EZ Empty + .---------------------------------------------. .---------------------------------------------. + | | | | | | | | ! | | | | | | | + !-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------! + | | | | | | | | ! | | | | | | | + !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! + | | | | | | |-------! !-------! | | | | | | + !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! + | | | | | | | | ! | | | | | | | + '-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------' + | | | | | | ! | | | | | + '------------------------------' '------------------------------' + .---------------. .---------------. + | | | ! | | + .-------+-------+-------! !-------+-------+-------. + ! ! | | ! | ! ! + ! ! !-------! !-------! ! ! + | | | | ! | | | + '-----------------------' '-----------------------' + + ---------- LEFT HAND ----------- ---------- RIGHT HAND ---------- + ( \ + L00,L01,L02,L03,L04,L05,L06, R00,R01,R02,R03,R04,R05,R06, \ + L10,L11,L12,L13,L14,L15,L16, R10,R11,R12,R13,R14,R15,R16, \ + L20,L21,L22,L23,L24,L25, R21,R22,R23,R24,R25,R26, \ + L30,L31,L32,L33,L34,L35,L36, R30,R31,R32,R33,R34,R35,R36, \ + L40,L41,L42,L43,L44, R42,R43,R44,R45,R46, \ + L55,L56, R50,R51, \ + L54, R52, \ + L53,L52,L51, R55,R54,R53 \ + ) +*/ +# define WRAPPER_ergodox_ez(...) LAYOUT_ergodox_pretty(__VA_ARGS__) + +/** Common Wrapper + .---------------------------------------------. .---------------------------------------------. + | X | X | X | X | X | X | X | ! X | X | X | X | X | X | X | + !-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------! + | X | | | | | | X | ! X | | | | | | X | + !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! + | X | | | | | |-------! !-------! | | | | | X | + !-------+-----+-----+-----x-----x-----! X ! ! X !-----x-----x-----+-----+-----+-------! + | X | | | | | | | ! | | | | | | X | + '-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------' + | SPCL | | | | | ! | | | | SPCL | + '------------------------------' '------------------------------' + .---------------. .---------------. + | X | X | ! X | X | + .-------+-------+-------! !-------+-------+-------. + ! Space ! BSpace| X | ! X | Tab ! Enter ! + ! / ! / !-------! !-------! / ! / ! + | LOWER | Hyper | LEAD | ! CCCV | Meh | RAISE | + '-----------------------' '-----------------------' +*/ +# define WRAPPER_ergodox_common( \ + L11,L12,L13,L14,L15, R11,R12,R13,R14,R15, \ + L21,L22,L23,L24,L25, R21,R22,R23,R24,R25, \ + L31,L32,L33,L34,L35, R31,R32,R33,R34,R35, \ + L41,L42,L43,L44, R42,R43,R44,R45 \ + ) WRAPPER_ergodox_ez( \ + XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \ + XXXXXXX, L11, L12, L13, L14, L15, XXXXXXX, XXXXXXX, R11, R12, R13, R14, R15, XXXXXXX, \ + XXXXXXX, L21, L22, L23, L24, L25, R21, R22, R23, R24, R25, XXXXXXX, \ + KC_LSFT, L31, L32, L33, L34, L35, XXXXXXX, XXXXXXX, R31, R32, R33, R34, R35, KC_RSFT, \ + MO(_SPECIAL), L41, L42, L43, L44, R42, R43, R44, R45, MO(_SPECIAL), \ + \ + XXXXXXX,XXXXXXX, XXXXXXX,XXXXXXX, \ + XXXXXXX, XXXXXXX, \ + LT(_LOWER, KC_SPC),HYPR_T(KC_BSPC),KC_LEAD, KC_CCCV,SFT_T(KC_TAB),LT(_RAISE, KC_ENT) ) + +/** Common Wrapper with Mod Tap/Hold overlay + .---------------------------------------------. .---------------------------------------------. + | X | X | X | X | X | X | X | ! X | X | X | X | X | X | X | + !-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------! + | X | | | | | | X | ! X | | | | | | X | + !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! + | X | |Shift| Cmd | Alt | |-------! !-------! | Alt | Cmd |Shift| | X | + !-------+-----+-----+-----x-----x-----! X ! ! X !-----x-----x-----+-----+-----+-------! + | Sft | Ctl | | | | | | ! | | | | | Ctl | Sft | + '-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------' + | SPCL | | | | | ! | | | | SPCL | + '------------------------------' '------------------------------' + .---------------. .---------------. + | X | X | ! X | X | + .-------+-------+-------! !-------+-------+-------. + ! Space ! BSpace| X | ! X | Tab ! Enter ! + ! / ! / !-------! !-------! / ! / ! + | LOWER | Hyper | LEAD | ! CCCV | Meh | RAISE | + '-----------------------' '-----------------------' +*/ +# define WRAPPER_ergodox_mods( \ + L11,L12,L13,L14,L15, R11,R12,R13,R14,R15, \ + L21,L22,L23,L24,L25, R21,R22,R23,R24,R25, \ + L31,L32,L33,L34,L35, R31,R32,R33,R34,R35, \ + L41,L42,L43,L44, R42,R43,R44,R45 \ + ) WRAPPER_ergodox_common( \ + L11 , L12 , L13 , L14 , L15, R11, R12 , R13 , R14 , R15, \ + L21 , SFT_T(L22), GUI_T(L23), ALT_T(L24), L25, R21, ALT_T(R22), GUI_T(R23), SFT_T(R24), R25, \ + CTL_T(L31), L32 , L33 , L34 , L35, R31, R32 , R33 , R34 , CTL_T(R35), \ + L41 , L42 , L43 , L44 , R42 , R43 , R44 , R45 ) + +// These macros are used when defining layouts in keymap.c +# define LAYOUT_ergodox_common(...) WRAPPER_ergodox_common(__VA_ARGS__) +# define LAYOUT_ergodox_mods(...) WRAPPER_ergodox_mods(__VA_ARGS__) +#endif // END Keyboard specific wrapper defines +/** + * Alpha/Num key wrappers for portability + */ + +// Workman +#define __________________WORKMN_L1__________________ KC_Q, KC_D, KC_R, KC_W, KC_B +#define __________________WORKMN_L2__________________ KC_A, KC_S, KC_H, KC_T, KC_G +#define __________________WORKMN_L3__________________ KC_Z, KC_X, KC_M, KC_C, KC_V + +#define __________________WORKMN_R1__________________ KC_J, KC_F, KC_U, KC_P, KC_SCLN +#define __________________WORKMN_R2__________________ KC_Y, KC_N, KC_E, KC_O, KC_I +#define __________________WORKMN_R3__________________ KC_K, KC_L, KC_COMM, KC_DOT, KC_SLSH + +// QWERTY +#define __________________QWERTY_L1__________________ KC_Q, KC_W, KC_E, KC_R, KC_T +#define __________________QWERTY_L2__________________ KC_A, KC_S, KC_D, KC_F, KC_G +#define __________________QWERTY_L3__________________ KC_Z, KC_X, KC_C, KC_V, KC_B + +#define __________________QWERTY_R1__________________ KC_Y, KC_U, KC_I, KC_O, KC_P +#define __________________QWERTY_R2__________________ KC_H, KC_J, KC_K, KC_L, KC_SCLN +#define __________________QWERTY_R3__________________ KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH + +#define ________________QWERTY_R1_LHS________________ KC_P, KC_O, KC_I, KC_U, KC_Y +#define ________________QWERTY_R2_LHS________________ KC_SCLN, KC_L, KC_K, KC_J, KC_H +#define ________________QWERTY_R3_LHS________________ KC_SLSH, KC_DOT, KC_COMM, KC_M, KC_N + +// Nums +#define ___________________NUMS_L____________________ KC_1, KC_2, KC_3, KC_4, KC_5, KC_6 +#define ___________________NUMS_R____________________ KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL + +// Lower +#define __________________LOWER_L1___________________ KC_PGUP, KC_TAB, KC_UP, KC_ENT, KC_PGDN +#define __________________LOWER_L2___________________ KC_HOME, KC_LEFT, KC_DOWN, KC_RGHT, KC_END +#define __________________LOWER_L3___________________ KC_ESC, KC_BSPC, KC_CUT, KC_DEL, KC_CCCV + +#define __________________LOWER_R1___________________ XXXXXXX, KC_7, KC_8, KC_9, KC_ASTR +#define __________________LOWER_R2___________________ XXXXXXX, KC_4, KC_5, KC_6, KC_SLSH +#define __________________LOWER_R3___________________ XXXXXXX, KC_1, KC_2, KC_3, KC_MINS +// Relevant keys: -> KC_0, KC_DOT, KC_COMM, KC_PLUS <- these keys break our lovely wrapper pattern + +// Raise +#define __________________RAISE_L1___________________ KC_PIPE, KC_UNDS, KC_LBRC, KC_RBRC, KC_AMPR +#define __________________RAISE_L2___________________ KC_BSLS, KC_SLSH, KC_LCBR, KC_RCBR, KC_ASTR +#define __________________RAISE_L3___________________ KC_HASH, KC_DLR , KC_PERC, KC_TILD, KC_GRV + +#define __________________RAISE_R1___________________ KC_EXLM, KC_LABK, KC_RABK, KC_MINS, KC_SCLN +#define __________________RAISE_R2___________________ KC_QUES, KC_LPRN, KC_RPRN, KC_EQL, KC_COLN +#define __________________RAISE_R3___________________ KC_AT, KC_QUOT, KC_DQUO, KC_PLUS, KC_CIRC + +// Adjust +#define __________________ADJUST_L1__________________ KC_MAKE, DEBUG, RESET, TERM_ON, TERM_OFF +#define __________________ADJUST_L2__________________ KC__MUTE, KC__VOLDOWN, KC__VOLUP, KC_MPLY, KC_MNXT +#define __________________ADJUST_L3__________________ KC_VRSN, AU_ON, AU_OFF, CG_SWAP, CG_NORM + +#define __________________ADJUST_R1__________________ MU_MOD, MU_ON, MU_OFF, MI_ON, MI_OFF +#define __________________ADJUST_R2__________________ MUV_IN, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD +#define __________________ADJUST_R3__________________ MUV_DE, RGB_TOG, RGB_MOD, RGB_VAI, RGB_VAD +// clang-format on