diff options
Diffstat (limited to 'users/bocaj/bocaj.h')
| -rw-r--r-- | users/bocaj/bocaj.h | 190 |
1 files changed, 67 insertions, 123 deletions
diff --git a/users/bocaj/bocaj.h b/users/bocaj/bocaj.h index 7b537397f..04991a015 100644 --- a/users/bocaj/bocaj.h +++ b/users/bocaj/bocaj.h | |||
| @@ -1,141 +1,85 @@ | |||
| 1 | #ifndef USERSPACE | 1 | /* |
| 2 | #define USERSPACE | 2 | Copyright 2018 Jacob Jerrell <jacob.jerrell@gmail.com> @JacobJerrell |
| 3 | 3 | ||
| 4 | This program is free software: you can redistribute it and/or modify | ||
| 5 | it under the terms of the GNU General Public License as published by | ||
| 6 | the Free Software Foundation, either version 2 of the License, or | ||
| 7 | (at your option) any later version. | ||
| 8 | |||
| 9 | This program is distributed in the hope that it will be useful, | ||
| 10 | but WITHOUT ANY WARRANTY; without even the implied warranty of | ||
| 11 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the | ||
| 12 | GNU General Public License for more details. | ||
| 13 | |||
| 14 | You should have received a copy of the GNU General Public License | ||
| 15 | along with this program. If not, see <http://www.gnu.org/licenses/>. | ||
| 16 | */ | ||
| 17 | |||
| 18 | #pragma once | ||
| 4 | #include "quantum.h" | 19 | #include "quantum.h" |
| 20 | #include "version.h" | ||
| 21 | #include "eeprom.h" | ||
| 22 | #include "wrappers.h" | ||
| 23 | #include "process_records.h" | ||
| 24 | #ifdef TAP_DANCE_ENABLE | ||
| 25 | #include "tap_dances.h" | ||
| 26 | #endif // TAP_DANCE_ENABLE | ||
| 5 | 27 | ||
| 6 | /* *** *** *** *** *** * | 28 | /* Layer Names */ |
| 7 | * Define layer names * | ||
| 8 | * *** *** *** *** *** */ | ||
| 9 | enum userspace_layers { | 29 | enum userspace_layers { |
| 10 | _HWRKMN = 0, | 30 | _WORKMAN = 0, |
| 11 | _SWRKMN, | 31 | _WINWORKMAN, |
| 32 | _QWERTY, | ||
| 12 | _LOWER, | 33 | _LOWER, |
| 13 | _ADJUST, | 34 | _ADJUST, |
| 14 | _NUMS, | 35 | _DIABLO, |
| 15 | _NMOD, | ||
| 16 | _DIABLO | ||
| 17 | }; | 36 | }; |
| 18 | 37 | ||
| 19 | #define EECONFIG_USERSPACE (uint8_t *)19 | 38 | #if (defined(UNICODE_ENABLE) || defined(UNICODEMAP_ENABLE) || defined(UCIS_ENABLE)) |
| 39 | #define BOCAJ_UNICODE_MODE UC_OSX | ||
| 40 | #else | ||
| 41 | // set to 2 for UC_WIN, set to 4 for UC_WINC | ||
| 42 | #define BOCAJ_UNICODE_MODE 2 | ||
| 43 | #endif | ||
| 44 | |||
| 45 | /* | ||
| 46 | define modifiers here, since MOD_* doesn't seem to work for these | ||
| 47 | */ | ||
| 48 | #define MODS_SHIFT_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) | ||
| 49 | #define MODS_CTRL_MASK (MOD_BIT(KC_LCTL)|MOD_BIT(KC_RCTRL)) | ||
| 50 | #define MODS_ALT_MASK (MOD_BIT(KC_LALT)|MOD_BIT(KC_RALT)) | ||
| 51 | #define MODS_GUI_MASK (MOD_BIT(KC_LGUI)|MOD_BIT(KC_RGUI)) | ||
| 52 | |||
| 53 | bool mod_key_press_timer (uint16_t code, uint16_t mod_code, bool pressed); | ||
| 54 | bool mod_key_press (uint16_t code, uint16_t mod_code, bool pressed, uint16_t this_timer); | ||
| 55 | bool send_game_macro(const char *str, keyrecord_t *record, bool override); | ||
| 56 | void matrix_init_keymap(void); | ||
| 57 | void shutdown_keymap(void); | ||
| 58 | void suspend_power_down_keymap(void); | ||
| 59 | void suspend_wakeup_init_keymap(void); | ||
| 60 | void matrix_scan_keymap(void); | ||
| 61 | uint32_t layer_state_set_keymap (uint32_t state); | ||
| 62 | uint32_t default_layer_state_set_keymap (uint32_t state); | ||
| 63 | void led_set_keymap(uint8_t usb_led); | ||
| 64 | void eeconfig_init_keymap(void); | ||
| 65 | void tap(uint16_t keycode); | ||
| 66 | |||
| 20 | typedef union { | 67 | typedef union { |
| 21 | uint8_t raw; | 68 | uint8_t raw; |
| 22 | } userspace_config_t; | 69 | } userspace_config_t; |
| 23 | 70 | ||
| 24 | /* *** *** *** *** *** *** * | 71 | extern userspace_config_t userspace_config; |
| 25 | * Define Custom Keycodes * | ||
| 26 | * *** *** *** *** *** *** */ | ||
| 27 | enum userspace_custom_keycodes { | ||
| 28 | KC_EPRM = SAFE_RANGE, // can always be here | ||
| 29 | KC_SWRK, | ||
| 30 | KC_HWRK, | ||
| 31 | KC_VRSN, | ||
| 32 | JJ_COPY, | ||
| 33 | JJ_PSTE, | ||
| 34 | JJ_ARRW, | ||
| 35 | KC_CCCV, | ||
| 36 | MC_LOCK, | ||
| 37 | KC_DCLR, | ||
| 38 | NEW_SAFE_RANGE //use "NEWPLACEHOLDER for keymap specific codes | ||
| 39 | }; | ||
| 40 | |||
| 41 | // Space Cadet Hyper/Meh and [/] | ||
| 42 | #define HYP_LBK ALL_T(KC_LBRACKET) | ||
| 43 | #define MEH_RBK MEH_T(KC_RBRACKET) | ||
| 44 | |||
| 45 | // Layout beauti-/simpli-fication | ||
| 46 | #define KC_LWEN LT(_LOWER, KC_ENTER) | ||
| 47 | #define KC_ADJS TT(_ADJUST) | ||
| 48 | #define KC_NUMS TT(_NUMS) | ||
| 49 | #define LM_SHFT LM(_NMOD, MOD_LSFT) | ||
| 50 | #define XXXXXXX KC_NO | ||
| 51 | #define _______ KC_TRNS | ||
| 52 | |||
| 53 | void tap(uint16_t keycode); | ||
| 54 | |||
| 55 | /* *** *** *** *** *** *** * | ||
| 56 | * Diablo 3 Macro Handling * | ||
| 57 | * *** *** *** *** *** *** */ | ||
| 58 | 72 | ||
| 59 | // If Tap Dancing is enabled, we manage that here. | 73 | // If Tap Dancing is enabled, we manage that here. |
| 60 | // If it is not, then we define the KC_D3_# codes gracefully | 74 | // If it is not, then we define the KC_D3_# codes gracefully |
| 61 | #ifdef TAP_DANCE_ENABLE | 75 | #ifdef TAP_DANCE_ENABLE |
| 62 | enum { | 76 | #define KC_D3_1 TD(TD_D3_1) |
| 63 | TD_D3_1 = 0, | 77 | #define KC_D3_2 TD(TD_D3_2) |
| 64 | TD_D3_2, | 78 | #define KC_D3_3 TD(TD_D3_3) |
| 65 | TD_D3_3, | 79 | #define KC_D3_4 TD(TD_D3_4) |
| 66 | TD_D3_4, | ||
| 67 | }; | ||
| 68 | |||
| 69 | #define KC_D3_1 TD(TD_D3_1) | ||
| 70 | #define KC_D3_2 TD(TD_D3_2) | ||
| 71 | #define KC_D3_3 TD(TD_D3_3) | ||
| 72 | #define KC_D3_4 TD(TD_D3_4) | ||
| 73 | #else // !TAP_DANCE_ENABLE | 80 | #else // !TAP_DANCE_ENABLE |
| 74 | #define KC_D3_1 KC_1 | 81 | #define KC_D3_1 KC_1 |
| 75 | #define KC_D3_2 KC_2 | 82 | #define KC_D3_2 KC_2 |
| 76 | #define KC_D3_3 KC_3 | 83 | #define KC_D3_3 KC_3 |
| 77 | #define KC_D3_4 KC_4 | 84 | #define KC_D3_4 KC_4 |
| 78 | #endif // TAP_DANCE_ENABLE | 85 | #endif // TAP_DANCE_ENABLE |
| 79 | |||
| 80 | // Wrapper for handling of keymap 'blocks' | ||
| 81 | // not 100% sure what this first part does. Credit to Drashna | ||
| 82 | #if (!defined(LAYOUT) && defined(KEYMAP)) | ||
| 83 | #define LAYOUT KEYMAP | ||
| 84 | #endif | ||
| 85 | |||
| 86 | #define LAYOUT_ergodox_pretty_wrapper(...) LAYOUT_ergodox_pretty(__VA_ARGS__) | ||
| 87 | /* Pretty Layout | ||
| 88 | .---------------------------------------------. .---------------------------------------------. | ||
| 89 | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | ! 8 | 9 | 10 | 11 | 12 | 13 | 14 | | ||
| 90 | !-------+-----+-----+-----+-----+-------------! !-------+-----+-----+-----+-----+-----+-------! | ||
| 91 | | 15 | 16 | 17 | 18 | 19 | 20 | 21 | ! 22 | 23 | 24 | 25 | 26 | 27 | 28 | | ||
| 92 | !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! | ||
| 93 | | 29 | 30 | 31 | 32 | 33 | 34 |-------! !-------! 35 | 36 | 37 | 38 | 39 | 40 | | ||
| 94 | !-------+-----+-----+-----x-----x-----! ! ! !-----x-----x-----+-----+-----+-------! | ||
| 95 | | 41 | 42 | 43 | 44 | 45 | 46 | 47 | ! 48 | 49 | 50 | 51 | 52 | 53 | 54 | | ||
| 96 | '-------+-----+-----+-----+-----+-------------' '-------------+-----+-----+-----+-----+-------' | ||
| 97 | | 55 | 56 | 57 | 58 | 59 | .---------------. .---------------. ! 60 | 61 | 62 | 63 | 64 | | ||
| 98 | '------------------------------' | 65 | 66 | ! 67 | 68 | '------------------------------' | ||
| 99 | .-------+-------+-------! !-------+-------+-------. | ||
| 100 | ! ! | 69 | ! 70 | ! ! | ||
| 101 | ! ! !-------! !-------! ! ! | ||
| 102 | | 71 | 72 | 73 | ! 74 | 75 | 76 | | ||
| 103 | '-----------------------' '-----------------------' | ||
| 104 | */ | ||
| 105 | |||
| 106 | #define _______________________SWORKMAN_L1_______________________ KC_Q, KC_W, KC_E, KC_R, KC_T | ||
| 107 | #define _______________________SWORKMAN_L2_______________________ KC_A, SFT_T(KC_S), GUI_T(KC_D), ALT_T(KC_F), KC_G | ||
| 108 | #define _______________________SWORKMAN_L3_______________________ CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B | ||
| 109 | |||
| 110 | #define _______________________SWORKMAN_R1_______________________ KC_Y, KC_U, KC_I, KC_O, KC_P | ||
| 111 | #define _______________________SWORKMAN_R2_______________________ KC_H, ALT_T(KC_J), GUI_T(KC_K), SFT_T(KC_L), KC_SCLN | ||
| 112 | #define _______________________SWORKMAN_R3_______________________ KC_N, KC_M, KC_COMM, KC_DOT, CTL_T(KC_SLASH) | ||
| 113 | |||
| 114 | // Hardware Driven Workman | ||
| 115 | #define _______________________HWORKMAN_L1_______________________ KC_Q, KC_D, KC_R, KC_W, KC_B | ||
| 116 | #define _______________________HWORKMAN_L2_______________________ KC_A, SFT_T(KC_S), GUI_T(KC_H), ALT_T(KC_T), KC_G | ||
| 117 | #define _______________________HWORKMAN_L3_______________________ CTL_T(KC_Z), KC_X, KC_M, KC_C, KC_V | ||
| 118 | |||
| 119 | #define _______________________HWORKMAN_R1_______________________ KC_J, KC_F, KC_U, KC_P, KC_SCLN | ||
| 120 | #define _______________________HWORKMAN_R2_______________________ KC_Y, ALT_T(KC_N), GUI_T(KC_E), SFT_T(KC_O), KC_I | ||
| 121 | #define _______________________HWORKMAN_R3_______________________ KC_K, KC_L, KC_COMM, KC_DOT, CTL_T(KC_SLASH) | ||
| 122 | |||
| 123 | #define ___________________ERGODOX_BOTTOM_LEFT___________________ TT(_DIABLO), KC_NUMS, TT(_LOWER), KC_UP, KC_LEFT | ||
| 124 | #define ___________________ERGODOX_BOTTOM_RIGHT__________________ KC_RIGHT, KC_DOWN, XXXXXXX, XXXXXXX, TT(_ADJUST) | ||
| 125 | |||
| 126 | #define _______________________NUMBER_LEFT_______________________ KC_1, KC_2, KC_3, KC_4, KC_5 | ||
| 127 | #define _______________________NUMBER_RIGHT______________________ KC_6, KC_7, KC_8, KC_9, KC_0 | ||
| 128 | |||
| 129 | #define _______________________SPECIAL_LEFT______________________ KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC | ||
| 130 | #define _______________________SPECIAL_RIGHT_____________________ KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN | ||
| 131 | |||
| 132 | #define _________________________________________________________ KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS | ||
| 133 | #define XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX KC_NO, KC_NO, KC_NO, KC_NO, KC_NO | ||
| 134 | |||
| 135 | // LEFT | RIGHT | ||
| 136 | #define ______________________ERGODOX_THUMBS_____________________ KC_APP,KC_HOME, KC_PGUP,KC_ESC, \ | ||
| 137 | KC_END, KC_PGDOWN, \ | ||
| 138 | KC_SPACE,KC_BSPACE,JJ_COPY, JJ_PSTE,KC_TAB,KC_LWEN | ||
| 139 | |||
| 140 | |||
| 141 | #endif // !USERSPACE | ||
