From 5da348b2d0fc419e74265f22b4df458ce8805ad2 Mon Sep 17 00:00:00 2001 From: Joe Wasson Date: Sat, 10 Mar 2018 17:18:30 -0800 Subject: [PATCH] Add userspace to talljoe layout. --- .../60_ansi_split_bs_rshift/talljoe/config.h | 4 +- .../60_ansi_split_bs_rshift/talljoe/keymap.c | 48 ++----------------- users/talljoe/readme.md | 7 +++ users/talljoe/rules.mk | 1 + users/talljoe/talljoe.c | 38 +++++++++++++++ users/talljoe/talljoe.h | 45 +++++++++++++++++ 6 files changed, 95 insertions(+), 48 deletions(-) create mode 100644 users/talljoe/readme.md create mode 100644 users/talljoe/rules.mk create mode 100644 users/talljoe/talljoe.c create mode 100644 users/talljoe/talljoe.h diff --git a/layouts/community/60_ansi_split_bs_rshift/talljoe/config.h b/layouts/community/60_ansi_split_bs_rshift/talljoe/config.h index f5ab0c8dc6..c0bb156534 100644 --- a/layouts/community/60_ansi_split_bs_rshift/talljoe/config.h +++ b/layouts/community/60_ansi_split_bs_rshift/talljoe/config.h @@ -3,8 +3,6 @@ #include QMK_KEYBOARD_CONFIG_H -#define PREVENT_STUCK_MODIFIERS - #define KM LAYOUT_60_ansi_split_bs_rshift -#endif //CONFIG_USER_H \ No newline at end of file +#endif //CONFIG_USER_H diff --git a/layouts/community/60_ansi_split_bs_rshift/talljoe/keymap.c b/layouts/community/60_ansi_split_bs_rshift/talljoe/keymap.c index 7eff999305..ee9a3f3ae5 100644 --- a/layouts/community/60_ansi_split_bs_rshift/talljoe/keymap.c +++ b/layouts/community/60_ansi_split_bs_rshift/talljoe/keymap.c @@ -1,41 +1,11 @@ #include QMK_KEYBOARD_H - -enum layers { - _BASE = 0, - _WORKMAN, - _NORMAN, - _DVORAK, - _COLMAK, - _GAME, - _NAV, - _ADJUST, - _RESET, -}; - -#define _______ KC_TRNS -#define XXXXXXX KC_NO - -#define NV_SPC LT(_NAV, KC_SPC) -#define AD_GRV LT(_ADJUST, KC_GRV) - -#define MO_NAV MO(_NAV) -#define MO_ADJ MO(_ADJUST) -#define MO_RST MO(_RESET) -#define TG_ADJ TG(_ADJUST) -#define TG_GAME TG(_GAME) -#define LY_QWER DF(_BASE) -#define LY_WORK DF(_WORKMAN) -#define LY_NRMN DF(_NORMAN) -#define LY_DVRK DF(_DVORAK) -#define LY_CLMK DF(_COLMAK) -#define TG_NKRO MAGIC_TOGGLE_NKRO -#define KC_PTT KC_F24 +#include "talljoe.h" const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [_BASE] = KM( KC_ESC , KC_1 , KC_2 , KC_3 , KC_4 , KC_5 , KC_6 , KC_7 , KC_8 , KC_9 , KC_0 , KC_MINS, KC_EQL , KC_BSLS, KC_GRV, KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , KC_LBRC, KC_RBRC, KC_BSPC, - KC_LCTL, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN, KC_QUOT, KC_ENT , + MS_MID , KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , KC_SCLN, KC_QUOT, KC_ENT , KC_LSFT, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , KC_SLSH, KC_RSFT, AD_GRV , KC_LCTL, KC_LGUI, KC_LALT, NV_SPC , KC_RALT, KC_RGUI, KC_RCTL, KC_PTT ), [_WORKMAN] = KM( @@ -79,7 +49,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { MO_RST , 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, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, TG_ADJ , - TG_NKRO, LY_QWER, LY_WORK, LY_NRMN, LY_DVRK, LY_CLMK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, TG_GAME, XXXXXXX, XXXXXXX, + TG_NKRO, LY_QWER, LY_WORK, LY_NRMN, LY_DVRK, LY_CLMK, XXXXXXX, XXXXXXX, XXXXXXX, KC_MAKE, TG_GAME, XXXXXXX, XXXXXXX, MO_RST , AG_NORM, AG_SWAP, BL_TOGG, XXXXXXX, XXXXXXX, XXXXXXX, KC_CAPS), // To Reset hit FN + ` + Esc [_RESET] = KM( @@ -99,15 +69,3 @@ void matrix_scan_user(void) { } #endif } - -void matrix_init_user(void) { - if (!eeconfig_is_enabled()) { - eeconfig_init(); - } -} - -uint32_t default_layer_state_set_kb(uint32_t state) { - // persist changes to default layers - eeconfig_update_default_layer(state); - return state; -} \ No newline at end of file diff --git a/users/talljoe/readme.md b/users/talljoe/readme.md new file mode 100644 index 0000000000..e70c5c6dc0 --- /dev/null +++ b/users/talljoe/readme.md @@ -0,0 +1,7 @@ +Copyright 2018 Joe Wasson @talljoe + +Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/users/talljoe/rules.mk b/users/talljoe/rules.mk new file mode 100644 index 0000000000..ac533fc5c5 --- /dev/null +++ b/users/talljoe/rules.mk @@ -0,0 +1 @@ +SRC += talljoe.c diff --git a/users/talljoe/talljoe.c b/users/talljoe/talljoe.c new file mode 100644 index 0000000000..2ea2878b6c --- /dev/null +++ b/users/talljoe/talljoe.c @@ -0,0 +1,38 @@ +#include "talljoe.h" + +void matrix_init_user(void) { + if (!eeconfig_is_enabled()) { + eeconfig_init(); + } +} + +uint32_t default_layer_state_set_kb(uint32_t state) { + // persist changes to default layers + eeconfig_update_default_layer(state); + return state; +} + +__attribute__ ((weak)) +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + return true; +} + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case KC_MAKE: // Compiles the firmware, and adds the flash command based on keyboard bootloader + if (!record->event.pressed) { + SEND_STRING("make " QMK_KEYBOARD ":" QMK_KEYMAP + #if (defined(BOOTLOADER_DFU) || defined(BOOTLOADER_LUFA_DFU) || defined(BOOTLOADER_QMK_DFU)) + ":dfu" + #elif defined(BOOTLOADER_HALFKAY) + ":teensy" + #elif defined(BOOTLOADER_CATERINA) + ":avrdude" + #endif + SS_TAP(X_ENTER)); + } + return false; + break; + } + return process_record_keymap(keycode, record); +} diff --git a/users/talljoe/talljoe.h b/users/talljoe/talljoe.h new file mode 100644 index 0000000000..7a2b491bd7 --- /dev/null +++ b/users/talljoe/talljoe.h @@ -0,0 +1,45 @@ +#ifndef USERSPACE +#define USERSPACE + +#include "quantum.h" + +#define PREVENT_STUCK_MODIFIERS + +enum layers { + _BASE = 0, + _WORKMAN, + _NORMAN, + _DVORAK, + _COLMAK, + _GAME, + _NAV, + _ADJUST, + _RESET, +}; + +#define _______ KC_TRNS +#define XXXXXXX KC_NO + +#define NV_SPC LT(_NAV, KC_SPC) +#define AD_GRV LT(_ADJUST, KC_GRV) + +#define MO_NAV MO(_NAV) +#define MO_ADJ MO(_ADJUST) +#define MO_RST MO(_RESET) +#define TG_ADJ TG(_ADJUST) +#define TG_GAME TG(_GAME) +#define LY_QWER DF(_BASE) +#define LY_WORK DF(_WORKMAN) +#define LY_NRMN DF(_NORMAN) +#define LY_DVRK DF(_DVORAK) +#define LY_CLMK DF(_COLMAK) +#define TG_NKRO MAGIC_TOGGLE_NKRO +#define KC_PTT KC_F24 +#define MS_MID KC_MS_BTN3 + +enum userspace_custom_keycodes { + KC_MAKE = SAFE_RANGE, // can always be here + NEW_SAFE_RANGE //use "NEWPLACEHOLDER for keymap specific codes +}; + +#endif