1 /* Copyright 2015-2018 Jack Humbert, Corey Kump
3 * This program is free software: you can redistribute it and/or modify
4 * it under the terms of the GNU General Public License as published by
5 * the Free Software Foundation, either version 2 of the License, or
6 * (at your option) any later version.
8 * This program is distributed in the hope that it will be useful,
9 * but WITHOUT ANY WARRANTY; without even the implied warranty of
10 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11 * GNU General Public License for more details.
13 * You should have received a copy of the GNU General Public License
14 * along with this program. If not, see <http://www.gnu.org/licenses/>.
18 #include "action_layer.h"
20 extern keymap_config_t keymap_config;
33 /* This include relies on the layer constants above and so must be declared after them */
36 enum planck_keycodes {
45 #define KC_____ KC_TRNS
51 * Custom Corvec Bindings
53 * Previously used but currently unused bindings are commented out.
56 // Activate the Wobble layer
57 #define KC_WOBL MO(_WOBBLE)
58 // Dual function with Raise
59 #define KC_RESC LT(_RAISE, KC_ESC)
60 // Dual functions with Lower
61 #define KC_LENT LT(_LOWER, KC_ENT)
62 #define KC_LQUT LT(_LEANDOWN, KC_QUOT)
63 // Dual functions with Shift
64 #define KC_SDEL MT(MOD_LSFT, KC_DEL)
65 #define KC_SAPP MT(MOD_LSFT, KC_APP)
68 * Functions taking advantage of tap dance:
70 // Tap once: quote. Hold: LEANDOWN layer. Tap twice: minus.
71 #define KC_TQTD TD(TD_QUOT_LEAN_MINS)
72 // Tap once: [. Hold: RALT. Tap twice: {
73 #define KC_TALT TD(TD_LBRC_RALT_LCBR)
74 // Tap once: ]. Hold: RGUI. Tap twice: }
75 #define KC_TGUI TD(TD_RBRC_RGUI_RCBR)
78 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
80 [_COLEMAK] = KC_KEYMAP(
81 //-----+----+----+----+----+----+----+----+----+----+----+----
82 TAB , Q , W , F , P , G , J , L , U , Y ,SCLN,BSPC,
83 //-----+----+----+----+----+----+----+----+----+----+----+----
84 RESC, A , R , S , T , D , H , N , E , I , O ,TQTD,
85 //-----+----+----+----+----+----+----+----+----+----+----+----
86 LSFT, Z , X , C , V , B , K , M ,COMM,DOT ,SLSH,RSFT,
87 //-----+----+----+----+----+----+----+----+----+----+----+----
88 LCTL,LGUI,WOBL,LALT,LENT, SPC, SPC,RASE,SDEL,TALT,TGUI,RCTL
91 [_QWERTY] = KC_KEYMAP(
92 //-----+----+----+----+----+----+----+----+----+----+----+----
93 TAB , Q , W , E , R , T , Y , U , I , O , P ,BSPC,
94 //-----+----+----+----+----+----+----+----+----+----+----+----
95 RESC, A , S , D , F , G , H , J , K , L ,SCLN,TQTD,
96 //-----+----+----+----+----+----+----+----+----+----+----+----
97 LSFT, Z , X , C , V , B , N , M ,COMM,DOT ,SLSH,RSFT,
98 //-----+----+----+----+----+----+----+----+----+----+----+----
99 LCTL,LGUI,WOBL,LALT,LENT, SPC, SPC,RASE,RALT,SAPP,RGUI,RCTL
102 [_LOWER] = KC_KEYMAP(
103 GRV ,EXLM, AT ,HASH, DLR,PERC,CIRC,AMPR,ASTR,LPRN,RPRN,____,
104 ____,LPRN,RPRN,LBRC,RBRC,XXXX,LEFT,DOWN, UP ,RGHT,XXXX,MINS,
105 ____,BSLS,TILD,PIPE,EQL ,UNDS,HOME,PGDN,PGUP,END ,BSLS,____,
106 ____,____,____,____,____,____,____,____,____,____,____,____
109 [_LEANDOWN] = KC_KEYMAP(
110 GRV ,EXLM, AT ,HASH, DLR,PERC,CIRC,AMPR,ASTR,LPRN,RPRN,____,
111 ____,LPRN,RPRN,LBRC,RBRC,LCBR,LCBR,DLR ,PERC,CIRC,____,____,
112 ____,BSLS,TILD,PIPE,EQL ,UNDS,HOME,EXLM, AT ,HASH,BSLS,____,
113 ____,____,____,____,____,____,____,____,LEFT,DOWN, UP ,RGHT
116 [_RAISE] = KC_KEYMAP(
117 GRV , 1 , 2 , 3 , 4 , 5 , 6 , 7 , 8 , 9 , 0 ,____,
118 ____,LPRN,RPRN,LCBR,RCBR,XXXX,XXXX, 4 , 5 , 6 ,PPLS,MINS,
119 ____,BSLS,TILD,PIPE,EQL ,UNDS,XXXX, 1 , 2 , 3 ,PAST,____,
120 ____,____,____,____,____,____,____,____,____,____,____,____
123 [_WOBBLE] = KC_KEYMAP(
124 GRV , F1 , F2 , F3 , F4 , NO ,MUTE,VOLD,VOLU, NO , NO , DEL,
125 , F5 , F6 , F7 , F8 , NO ,MPRV,MPLY,MSTP,MNXT, NO ,BSLS,
126 , F9 , F10, F11, F12, NO , NO , NO , NO , INS,PSCR, ,
127 , , , , , , , , , , ,
130 /* Adjust (Lower + Raise)
131 * ,-----------------------------------------------------------------------------------.
132 * |Colemk| | Debug|RGB Tg|RGB Md|RGB H+|RGB H-|RGB S+|RGB S-|RGB V+|RGB V-|Qwerty|
133 * |------+------+------+------+------+-------------+------+------+------+------+------|
134 * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk| |AS On | AS + |
135 * |------+------+------+------+------+------|------+------+------+------+------+------|
136 * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof|TermOn|TermOf|AS Rep|AS Off| AS - |
137 * |------+------+------+------+------+------+------+------+------+------+------+------|
138 * | | | | | | | | | | | Reset|
139 * `-----------------------------------------------------------------------------------'
143 {COLEMAK, _______, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, QWERTY },
144 {_______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, _______, KC_ASON, KC_ASUP},
145 {_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF,KC_ASRP, KC_ASOFF,KC_ASDN},
146 {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET }
153 float plover_song[][2] = SONG(PLOVER_SOUND);
154 float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND);
157 bool process_record_user(uint16_t keycode, keyrecord_t *record) {
160 if (record->event.pressed) {
161 print("mode just switched to qwerty and this is a huge string\n");
162 set_single_persistent_default_layer(_QWERTY);
167 if (record->event.pressed) {
168 set_single_persistent_default_layer(_COLEMAK);
173 if (record->event.pressed) {
175 update_tri_layer(_LOWER, _RAISE, _ADJUST);
178 update_tri_layer(_LOWER, _RAISE, _ADJUST);
183 if (record->event.pressed) {
185 update_tri_layer(_LOWER, _RAISE, _ADJUST);
188 update_tri_layer(_LOWER, _RAISE, _ADJUST);
193 if (record->event.pressed) {
194 register_code(KC_RSFT);
195 #ifdef BACKLIGHT_ENABLE
200 unregister_code(KC_RSFT);