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: [Keymap] JJerrell - Add Userspace and ZSA Keyboard Keymaps (#13548) --- 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 +++ 8 files changed, 169 insertions(+), 221 deletions(-) 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 (limited to 'layouts/community/ergodox') 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<