diff options
author | Jarred Steenvoorden <jazzjarred@gmail.com> | 2019-03-11 04:00:55 +1100 |
---|---|---|
committer | MechMerlin <30334081+mechmerlin@users.noreply.github.com> | 2019-03-10 10:00:55 -0700 |
commit | ff95c60e464256261777f3a5b159f121fa5d655d (patch) | |
tree | eb705bcf18221146c3509c26c64ecdb7d47c875c /users/jarred | |
parent | 9d915ed051c43edd828d6cdb784a5d094e9b312d (diff) | |
download | firmware-ff95c60e464256261777f3a5b159f121fa5d655d.tar.gz firmware-ff95c60e464256261777f3a5b159f121fa5d655d.tar.bz2 firmware-ff95c60e464256261777f3a5b159f121fa5d655d.zip |
Keymap / userspace update (#5358)
* Update userspace with common config.h
* Add my dz60, satan and xd75 keyboard keymaps
* Fixing executable bits changed during last upstream merge
* Cleanup unnecessary files and defines
* Remove unnecessary defines from userspace config
* Add underglow controls to dz60 function layer
* Fixing merge conflicts
* Fixing exectable bits changed during merge
* Userspace update
Diffstat (limited to 'users/jarred')
-rw-r--r-- | users/jarred/config.h | 1 | ||||
-rw-r--r-- | users/jarred/jarred.c | 69 | ||||
-rw-r--r-- | users/jarred/jarred.h | 83 |
3 files changed, 131 insertions, 22 deletions
diff --git a/users/jarred/config.h b/users/jarred/config.h index f28208814..e63ec4d9b 100644 --- a/users/jarred/config.h +++ b/users/jarred/config.h @@ -39,6 +39,7 @@ #undef TAPPING_TERM #undef IGNORE_MOD_TAP_INTERRUPT +#define PERMISSIVE_HOLD #define TAPPING_TOGGLE 1 #define TAPPING_TERM 200 #define IGNORE_MOD_TAP_INTERRUPT diff --git a/users/jarred/jarred.c b/users/jarred/jarred.c index 33162b689..b37c4cfbb 100644 --- a/users/jarred/jarred.c +++ b/users/jarred/jarred.c @@ -17,16 +17,81 @@ #include "jarred.h" #include "version.h" +__attribute__ ((weak)) +bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { + return true; +} + +bool lowerPressed, raisePressed; + bool process_record_user(uint16_t keycode, keyrecord_t *record) { switch (keycode) { + case LOWER: + case RAISE: + // Both lower and raise activate the same layer + if (record->event.pressed) { + layer_on(_LW); + } else { + layer_off(_LW); + } + + // But keep track of each to active adjust layer + if (keycode == LOWER) { + lowerPressed = record->event.pressed; + } else { + raisePressed = record->event.pressed; + } + + // When both are pressed, activate adjust + if (lowerPressed && raisePressed) { + layer_on(_NP); + } else { + layer_off(_NP); + } + + break; + + case NUMPAD: + if (record->event.pressed) { + layer_on(_NP); + } else { + layer_off(_NP); + } + break; + + case NAVI: + if (record->event.pressed) { + layer_on(_NV); + } else { + layer_off(_NV); + + // Release mods set by ALT_TAB and CTL_TAB + unregister_code(KC_LALT); + unregister_code(KC_LCTL); + } + 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), MACRO_TIMER); } - return false; + break; + + case ALT_TAB: + if (record->event.pressed) { + register_code(KC_LALT); + tap_code(KC_TAB); + } + break; + + case CTL_TAB: + if (record->event.pressed) { + register_code(KC_LCTL); + tap_code(KC_TAB); + } break; } - return true; + return process_record_keymap(keycode, record); } diff --git a/users/jarred/jarred.h b/users/jarred/jarred.h index a6774ce26..3f27163ab 100644 --- a/users/jarred/jarred.h +++ b/users/jarred/jarred.h @@ -13,6 +13,8 @@ * You should have received a copy of the GNU General Public License * along with this program. If not, see <http://www.gnu.org/licenses/>. */ + +// TODO: Add Alt-Tab to nav + W layer #ifndef USERSPACE #define USERSPACE @@ -20,31 +22,58 @@ #include "quantum.h" enum userspace_custom_keycodes { - VRSN = SAFE_RANGE // Prints QMK Firmware and board info + VRSN = SAFE_RANGE, // Prints QMK Firmware and board info + ALT_TAB, + CTL_TAB, + + // Layer keys + NAVI, + LOWER, + RAISE, + NUMPAD }; // Layers -#define _QW 0 -#define _LW 1 -#define _NV 2 -#define _NP 3 -#define _MS 4 // Mouse +enum { + _QW = 0, + _GAME, + _LW, + _NV, + _NP, + _MS, +}; + +#define MS_A LT(_MS,KC_A) -#define MS_A LT(_MS,KC_A) +#define WIN_Z LGUI_T(KC_Z) +#define CTL_SLH RCTL_T(KC_SLSH) // Wrappers #define LAYOUT_planck_grid_wrapper(...) LAYOUT_planck_grid(__VA_ARGS__) /* Qwerty Layer */ #define QWERTY_L1 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T -#define QWERTY_L2 MO(_NV), KC_A, KC_S, KC_D, KC_F, KC_G -#define QWERTY_L3 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B -#define QWERTY_L4 KC_LCTL, KC_LGUI, MO(_NP), KC_LALT, MO(_LW), KC_SPC +#define QWERTY_L2 NAVI, KC_A, KC_S, KC_D, KC_F, KC_G +#define QWERTY_L3 KC_LSFT, WIN_Z, KC_X, KC_C, KC_V, KC_B +#define QWERTY_L4 KC_LCTL, KC_LGUI, NUMPAD, KC_LALT, LOWER, KC_SPC #define QWERTY_R1 KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC #define QWERTY_R2 KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT -#define QWERTY_R3 KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT -#define QWERTY_R4 KC_ENT, MO(_LW), KC_RALT, MO(_MS), KC_APP, KC_RCTL +#define QWERTY_R3 KC_N, KC_M, KC_COMM, KC_DOT, CTL_SLH, KC_RSFT +#define QWERTY_R4 KC_ENT, RAISE, KC_RALT, MO(_MS), KC_APP, KC_RCTL + +#define QWERTY_4_DOX KC_LCTL, LOWER, KC_SPC, KC_ENT, RAISE, KC_RALT + +/* Game Layer */ +#define GAME_L1 _______, _______, _______, _______, _______, _______ +#define GAME_L2 _______, _______, _______, _______, _______, _______ +#define GAME_L3 _______, _______, _______, _______, _______, _______ +#define GAME_L4 _______, _______, KC_LALT, LOWER, KC_SPC, KC_SPC + +#define GAME_R1 _______, _______, _______, _______, _______, _______ +#define GAME_R2 _______, _______, _______, _______, _______, _______ +#define GAME_R3 _______, _______, _______, _______, _______, _______ +#define GAME_R4 _______, _______, _______, _______, _______, _______ /* Lower / Upper Layer */ #define LOWER_L1 KC_ESC , KC_1, KC_2, KC_3, KC_4, KC_5 @@ -57,27 +86,33 @@ enum userspace_custom_keycodes { #define LOWER_R3 KC_F12, KC_GRV, _______, _______, _______, _______ #define LOWER_R4 _______, _______, _______, _______, _______, _______ +#define LOWER_4_DOX _______, _______, _______, _______, _______, _______ + /* Navigation Layer */ #define NAV_L1 _______, _______, _______, KC_LGUI, KC_DEL, KC_BSPC #define NAV_L2 _______, _______, _______, KC_LSFT, KC_LCTL, KC_ENT #define NAV_L3 _______, _______, _______, _______, _______, _______ -#define NAV_L4 _______, _______, _______, _______, _______, _______ +#define NAV_L4 _______, _______, _______, CTL_TAB, ALT_TAB, _______ #define NAV_R1 _______, KC_HOME, KC_UP , KC_END , KC_INS, _______ #define NAV_R2 _______, KC_LEFT, KC_DOWN, KC_RGHT, KC_DEL, _______ #define NAV_R3 _______, KC_PGUP, KC_PGDN, _______, _______, _______ -#define NAV_R4 _______, _______, _______, _______, _______, _______ +#define NAV_R4 _______, KC_APP, _______, _______, _______, _______ + +#define NAV_4_DOX CTL_TAB, ALT_TAB, _______, _______, KC_APP, _______ /* Numpad Layer */ -#define NUMPAD_L1 RGB_TOG, RGB_MOD, _______, _______, RGB_HUD, RGB_HUI +#define NUMPAD_L1 RGB_TOG, RGB_MOD,RGB_RMOD, _______, RGB_HUD, RGB_HUI #define NUMPAD_L2 BL_TOGG, BL_STEP, BL_BRTG, _______, RGB_SAD, RGB_SAI #define NUMPAD_L3 _______, _______, _______, _______, RGB_VAD, RGB_VAI -#define NUMPAD_L4 RESET, VRSN, _______, _______, RGB_SPD, RGB_SPI +#define NUMPAD_L4 _______, _______, _______, _______, RGB_SPD, RGB_SPI + +#define NUMPAD_R1 DF(_QW),DF(_GAME), _______, _______, _______, RESET +#define NUMPAD_R2 _______, _______, _______, _______, _______, _______ +#define NUMPAD_R3 VRSN, _______, _______, _______, _______, _______ +#define NUMPAD_R4 _______, _______, _______, _______, _______, _______ -#define NUMPAD_R1 _______, KC_P7, KC_P8, KC_P9, KC_PMNS, _______ -#define NUMPAD_R2 _______, KC_P4, KC_P5, KC_P6, KC_PPLS, _______ -#define NUMPAD_R3 _______, KC_P1, KC_P2, KC_P3, KC_PAST, KC_ENT -#define NUMPAD_R4 _______, KC_P0, XXXXXXX, KC_PDOT, KC_PSLS, KC_ENT +#define NUMPAD_4_DOX _______, _______, _______, _______, _______, _______ /* Mouse Layer */ #define MOUSE_L1 _______, _______, _______, _______, _______, _______ @@ -90,11 +125,18 @@ enum userspace_custom_keycodes { #define MOUSE_R3 _______, _______, _______, _______, _______, _______ #define MOUSE_R4 KC_BTN2, _______, _______, _______, _______, _______ +#define MOUSE_4_DOX _______, _______, _______, _______, _______, _______ + #define QWERTY_1_12 QWERTY_L1, QWERTY_R1 #define QWERTY_2_12 QWERTY_L2, QWERTY_R2 #define QWERTY_3_12 QWERTY_L3, QWERTY_R3 #define QWERTY_4_12 QWERTY_L4, QWERTY_R4 +#define GAME_1_12 GAME_L1, GAME_R1 +#define GAME_2_12 GAME_L2, GAME_R2 +#define GAME_3_12 GAME_L3, GAME_R3 +#define GAME_4_12 GAME_L4, GAME_R4 + #define LOWER_1_12 LOWER_L1, LOWER_R1 #define LOWER_2_12 LOWER_L2, LOWER_R2 #define LOWER_3_12 LOWER_L3, LOWER_R3 @@ -116,6 +158,7 @@ enum userspace_custom_keycodes { #define MOUSE_4_12 MOUSE_L4, MOUSE_R4 #define QWERTY_4x12 QWERTY_1_12, QWERTY_2_12, QWERTY_3_12, QWERTY_4_12 +#define GAME_4x12 GAME_1_12, GAME_2_12, GAME_3_12, GAME_4_12 #define LOWER_4x12 LOWER_1_12, LOWER_2_12, LOWER_3_12, LOWER_4_12 #define NAV_4x12 NAV_1_12, NAV_2_12, NAV_3_12, NAV_4_12 #define NUMPAD_4x12 NUMPAD_1_12, NUMPAD_2_12, NUMPAD_3_12, NUMPAD_4_12 |