diff --git a/keyboards/ergodox_ez/keymaps/bocaj/bocaj.h b/keyboards/ergodox_ez/keymaps/bocaj/bocaj.h new file mode 100644 index 0000000000..b549378eac --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/bocaj/bocaj.h @@ -0,0 +1,122 @@ +/* +Copyright 2018 Jacob Jerrell + +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 "quantum.h" +#include "sendstring_workman.h" + +// Layers +#define _HWRKMN 0 +#define _SWRKMN 1 +#define _NUMPAD 2 +#define _MOUSE 3 +#define _TOOLS 4 + +enum custom_keycodes { + KC_EPRM = SAFE_RANGE, + KC_SWRK, + KC_HWRK, + KC_VRSN, + JJ_COPY, + JJ_PASTE, + KC_SECRET_1, + KC_SECRET_2, + KC_SECRET_3, + KC_SECRET_4, + KC_SECRET_5, +}; + +enum { + TD_ARRW = 0 +}; + +void dance_arrow (qk_tap_dance_state_t *state, void *user_data) { + switch (state->count) { + case 1: + SEND_STRING("-"); + reset_tap_dance(state); + break; + case 2: + SEND_STRING("->"); + reset_tap_dance(state); + break; + } +} + +qk_tap_dance_action_t tap_dance_actions[] = { + [TD_ARRW] = ACTION_TAP_DANCE_FN(dance_arrow) +}; + +#define KC_SEC1 KC_SECRET_1 +#define KC_SEC2 KC_SECRET_2 +#define KC_SEC3 KC_SECRET_3 +#define KC_SEC4 KC_SECRET_4 +#define KC_SEC5 KC_SECRET_5 + +// Space Cadet Hyper/Meh and [/] +#define HYP_LBK ALL_T(KC_LBRACKET) +#define MEH_RBK MEH_T(KC_RBRACKET) + +#define XXXXXXX KC_NO + +#define LAYOUT_ergodox_pretty_wrapper(...) LAYOUT_ergodox_pretty(__VA_ARGS__) + +/* Pretty Layout +.---------------------------------------------. .---------------------------------------------. +| 1 | 2 | 3 | 4 | 5 | 6 | 7 | ! 8 | 9 | 10 | 11 | 12 | 13 | 14 | +!-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------! +| 15 | 16 | 17 | 18 | 19 | 20 | 21 | ! 22 | 23 | 24 | 25 | 26 | 27 | 28 | +!-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! +| 29 | 30 | 31 | 32 | 33 | 34 |-------! !-------! 35 | 36 | 37 | 38 | 39 | 40 | +!-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! +| 41 | 42 | 43 | 44 | 45 | 46 | 47 | ! 48 | 49 | 50 | 51 | 52 | 53 | 54 | +'-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------' + | 55 | 56 | 57 | 58 | 59 | .---------------. .---------------. ! 60 | 61 | 62 | 63 | 64 | + '------------------------------' | 65 | 66 | ! 67 | 68 | '------------------------------' + .-------+-------+-------! !-------+-------+-------. + ! ! | 69 | ! 70 | ! ! + ! ! !-------! !-------! ! ! + | 71 | 72 | 73 | ! 74 | 75 | 76 | + '-----------------------' '-----------------------' +*/ + +#define _____________________ERGODOX_TOP_LEFT__________________ KC_GESC, KC_1, KC_2, KC_3, KC_4, KC_5, SH_TG +#define _____________________ERGODOX_TOP_RIGHT_________________ TD_ARRW, KC_6, KC_7, KC_8, KC_9, KC_0, KC_EQUAL +#define _____________________ERGODOX_BOTTOM_LEFT_______________ TG(_MOUSE), TG(_NUMPAD), XXXXXXX, KC_UP, KC_LEFT +#define _____________________ERGODOX_BOTTOM_RIGHT______________ KC_RIGHT, KC_DOWN, KC_SEC1, KC_SEC2, TT(_TOOLS) + +// LEFT | RIGHT +#define _____________ERGODOX_THUMBS____________ KC_APP,KC_HOME, KC_PGUP,KC_ESC, \ + KC_END, KC_PGDOWN, \ + KC_SPACE,KC_BSPACE,JJ_COPY, JJ_PASTE,KC_TAB,KC_ENTER + +// Software Driven Workman (basically QWERTY but I'm a purist) +#define ______________SWORKMAN_L1______________ WK_Q, WK_D, WK_R, WK_W, WK_B +#define ______________SWORKMAN_L2______________ WK_A, SFT_T(WK_S), GUI_T(WK_H), ALT_T(WK_T), WK_G +#define ______________SWORKMAN_L3______________ CTL_T(WK_Z), WK_X, WK_M, WK_C, WK_V + +#define ______________SWORKMAN_R1______________ WK_J, WK_F, WK_U, WK_P, WK_SCLN +#define ______________SWORKMAN_R2______________ WK_Y, ALT_T(WK_N), GUI_T(WK_E), SFT_T(WK_O), WK_I +#define ______________SWORKMAN_R3______________ WK_K, WK_L, KC_COMM, KC_DOT, CTL_T(KC_SLASH) + +// Hardware Driven Workman +#define ______________HWORKMAN_L1______________ KC_Q, KC_D, KC_R, KC_W, KC_B +#define ______________HWORKMAN_L2______________ KC_A, SFT_T(KC_S), GUI_T(KC_H), ALT_T(KC_T), KC_G +#define ______________HWORKMAN_L3______________ CTL_T(KC_Z), KC_X, KC_M, KC_C, KC_V + +#define ______________HWORKMAN_R1______________ KC_J, KC_F, KC_U, KC_P, KC_SCLN +#define ______________HWORKMAN_R2______________ KC_Y, ALT_T(KC_N), GUI_T(KC_E), SFT_T(KC_O), KC_I +#define ______________HWORKMAN_R3______________ KC_K, KC_L, KC_COMM, KC_DOT, CTL_T(KC_SLASH) diff --git a/keyboards/ergodox_ez/keymaps/bocaj/config.h b/keyboards/ergodox_ez/keymaps/bocaj/config.h new file mode 100644 index 0000000000..05b1dfbd7d --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/bocaj/config.h @@ -0,0 +1,43 @@ +#ifndef USERSPACE_CONFIG_H + #define USERSPACE_CONFIG_H + + #ifndef ONESHOT_TAP_TOGGLE + #define ONESHOT_TAP_TOGGLE 2 + #endif // ONESHOT_TAP_TOGGLE + + #ifndef ONESHOT_TIMEOUT + #define ONESHOT_TIMEOUT 3000 + #endif // ONESHOT_TIMEOUT + + #ifndef QMK_KEYS_PER_SCAN + #define QMK_KEYS_PER_SCAN 4 + #endif // QMK KEYS PER SCAN + + // Testing Autoshift + #define NO_AUTO_SHIFT_SPECIAL + #define NO_AUTO_SHIFT_NUMERIC + #define AUTO_SHIFT_SETUP + + // 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 + #undef PREVENT_STUCK_MODIFIERS + + #ifndef TAPPING_TOGGLE + #define TAPPING_TOGGLE 2 + #endif + + #ifdef TAPPING_TERM + #undef TAPPING_TERM + #endif + #define TAPPING_TERM 200 + + // Disable action_get_macro and fn_actions, since we don't use these + // and it saves on space in the firmware. + #define NO_ACTION_MACRO + #define NO_ACTION_FUNCTION + +#endif // !USERSPACE_CONFIG_H diff --git a/keyboards/ergodox_ez/keymaps/bocaj/keymap.c b/keyboards/ergodox_ez/keymaps/bocaj/keymap.c new file mode 100644 index 0000000000..b5ba1f14f4 --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/bocaj/keymap.c @@ -0,0 +1,170 @@ +/* +Copyright 2018 Jacob Jerrell +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 QMK_KEYBOARD_H +#include "bocaj.h" +#include "version.h" +#include "action_layer.h" +#include "secrets.h" + +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [_HWRKMN] = LAYOUT_ergodox_pretty_wrapper( + _____________________ERGODOX_TOP_LEFT__________________, _____________________ERGODOX_TOP_RIGHT_________________, + KC_DEL,______________HWORKMAN_L1______________,KC_LPRN, KC_RPRN,______________HWORKMAN_R1______________,KC_BSLS, +TT(_NUMPAD),______________HWORKMAN_L2______________, ______________HWORKMAN_R2______________,KC_QUOT, + KC_LSFT,______________HWORKMAN_L3______________,HYP_LBK, MEH_RBK,______________HWORKMAN_R3______________,KC_RSFT, + _____________________ERGODOX_BOTTOM_LEFT_______________, _____________________ERGODOX_BOTTOM_RIGHT______________, + _____________ERGODOX_THUMBS____________ + ), + [_SWRKMN] = LAYOUT_ergodox_pretty_wrapper( + _____________________ERGODOX_TOP_LEFT__________________, _____________________ERGODOX_TOP_RIGHT_________________, + KC_DEL,______________SWORKMAN_L1______________,KC_LPRN, KC_RPRN,______________SWORKMAN_R1______________,KC_BSLS, +TT(_NUMPAD),______________SWORKMAN_L2______________, ______________SWORKMAN_R2______________,KC_QUOT, + KC_LSFT,______________SWORKMAN_L3______________,HYP_LBK, MEH_RBK,______________SWORKMAN_R3______________,KC_RSFT, + _____________________ERGODOX_BOTTOM_LEFT_______________, _____________________ERGODOX_BOTTOM_RIGHT______________, + _____________ERGODOX_THUMBS____________ + ), + [_NUMPAD] = LAYOUT_ergodox_pretty_wrapper( + XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,_______, XXXXXXX,XXXXXXX,KC_NLCK,KC_PSLS,KC_PAST,KC_PMNS,XXXXXXX, + XXXXXXX,XXXXXXX,XXXXXXX, KC_UP ,XXXXXXX,XXXXXXX,XXXXXXX, XXXXXXX,XXXXXXX,KC_KP_7,KC_KP_8,KC_KP_9,KC_PPLS,XXXXXXX, + _______,XXXXXXX,KC_LEFT,KC_DOWN,KC_RGHT,XXXXXXX, XXXXXXX,KC_KP_4,KC_KP_5,KC_KP_6,KC_PEQL,XXXXXXX, + KC_LSFT,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, XXXXXXX,XXXXXXX,KC_KP_1,KC_KP_2,KC_KP_3,KC_PENT,XXXXXXX, + XXXXXXX,_______,XXXXXXX,KC_LALT,KC_LGUI, KC_KP_0,KC_PDOT,KC_COMM,KC_PENT,XXXXXXX, + _____________ERGODOX_THUMBS____________ + ), + [_MOUSE] = LAYOUT_ergodox_pretty_wrapper( + XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,_______, XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, + XXXXXXX,XXXXXXX,XXXXXXX,KC_MS_U,XXXXXXX,XXXXXXX,XXXXXXX, XXXXXXX,XXXXXXX,KC_WH_L,KC_WH_U,KC_WH_R,XXXXXXX,XXXXXXX, + XXXXXXX,XXXXXXX,KC_MS_L,KC_MS_D,KC_MS_R,XXXXXXX, XXXXXXX,KC_ACL0,KC_ACL1,KC_ACL2,XXXXXXX,XXXXXXX, + XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, XXXXXXX,XXXXXXX,XXXXXXX,KC_WH_D,XXXXXXX,XXXXXXX,XXXXXXX, + _______,XXXXXXX,XXXXXXX,XXXXXXX,KC_BTN1, KC_BTN2,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, + _____________ERGODOX_THUMBS____________ + ), + [_TOOLS] = LAYOUT_ergodox_pretty_wrapper( + XXXXXXX,KC_SEC1,KC_SEC2,KC_SEC3,KC_SEC4,KC_SEC5,KC_EPRM, KC_EPRM,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, + XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, + KC_ASTG,KC_ASDN,KC_ASUP,KC_ASRP,XXXXXXX,XXXXXXX, XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, + XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, + XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX,XXXXXXX, XXXXXXX,XXXXXXX,KC_HWRK,KC_SWRK,_______, + _____________ERGODOX_THUMBS____________ + ) +}; + +const keypos_t hand_swap_config[MATRIX_ROWS][MATRIX_COLS] = { + /* Left hand, matrix positions */ + {{0,13}, {1,13}, {2,13}, {3,13}, {4,13}, {5,13}}, + {{0,12}, {1,12}, {2,12}, {3,12}, {4,12}, {5,12}}, + {{0,11}, {1,11}, {2,11}, {3,11}, {4,11}, {5,11}}, + {{0,10}, {1,10}, {2,10}, {3,10}, {4,10}, {5,10}}, + {{0,9}, {1,9}, {2,9}, {3,9}, {4,9}, {5,9}}, + {{0,8}, {1,8}, {2,8}, {3,8}, {4,8}, {5,8}}, + {{0,7}, {1,7}, {2,7}, {3,7}, {4,7}, {5,7}}, + /* Right hand, matrix positions */ + {{0,6}, {1,6}, {2,6}, {3,6}, {4,6}, {5,6}}, + {{0,5}, {1,5}, {2,5}, {3,5}, {4,5}, {5,5}}, + {{0,4}, {1,4}, {2,4}, {3,4}, {4,4}, {5,4}}, + {{0,3}, {1,3}, {2,3}, {3,3}, {4,3}, {5,3}}, + {{0,2}, {1,2}, {2,2}, {3,2}, {4,2}, {5,2}}, + {{0,1}, {1,1}, {2,1}, {3,1}, {4,1}, {5,1}}, + {{0,0}, {1,0}, {2,0}, {3,0}, {4,0}, {5,0}}, +}; + +void matrix_init_keymap(void) { // Runs boot tasks for keyboard +}; + +// Defines actions for my custom keycodes +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + // KC_COPY and KC_PASTE have problems with different hardware/software mappings + // e.g. If the mappings conflict, KC_COPY will send Cmd+M which minimizes the window + // JJ_COPY and JJ_PASTE fix this + case JJ_COPY: + if (!record->event.pressed) { + SEND_STRING(SS_LGUI("c")); + } + return false; + break; + case JJ_PASTE: + if (!record->event.pressed) { + SEND_STRING(SS_LGUI("v")); + } + return false; + break; + case KC_SWRK: + if (!record->event.pressed) { + set_single_persistent_default_layer(_SWRKMN); + layer_move(_SWRKMN); + ergodox_blink_all_leds(); + ergodox_blink_all_leds(); + } + return false; + break; + case KC_HWRK: + if (!record->event.pressed) { + set_single_persistent_default_layer(_HWRKMN); + layer_move(_HWRKMN); + ergodox_blink_all_leds(); + ergodox_blink_all_leds(); + } + return false; + break; + case KC_EPRM: + if (!record->event.pressed) { + ergodox_blink_all_leds(); + eeconfig_init(); + } + return false; + break; + case KC_VRSN: + if (!record->event.pressed) { + SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION ", Built on: " QMK_BUILDDATE); + } + return false; + break; + case KC_SECRET_1 ... KC_SECRET_5: // Secrets! Externally defined strings, not stored in repo + if (!record->event.pressed) { + clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED); + send_string_P(secret[keycode - KC_SECRET_1]); + } + return false; + break; + } + return true; +} + +void matrix_scan_user(void) { + uint8_t layer = biton32(layer_state); + ergodox_board_led_off(); + ergodox_right_led_1_off(); + ergodox_right_led_2_off(); + ergodox_right_led_3_off(); + switch (layer) { + case _NUMPAD: + ergodox_right_led_3_on(); + ergodox_right_led_3_set(10); + break; + case _MOUSE: + ergodox_right_led_2_on(); + ergodox_right_led_2_set(10); + break; + case _TOOLS: + ergodox_right_led_3_on(); + ergodox_right_led_2_on(); + ergodox_right_led_3_set(10); + ergodox_right_led_2_set(10); + break; + default: + // none + break; + } +}; diff --git a/keyboards/ergodox_ez/keymaps/bocaj/rules.mk b/keyboards/ergodox_ez/keymaps/bocaj/rules.mk new file mode 100644 index 0000000000..61c33eaacd --- /dev/null +++ b/keyboards/ergodox_ez/keymaps/bocaj/rules.mk @@ -0,0 +1,5 @@ +AUTO_SHIFT_ENABLE = no +COMMAND_ENABLE = no +SWAP_HANDS_ENABLE = yes +TAP_DANCE_ENABLE = yes +EXTRAKEY_ENABLE = no