aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCory Shaw <cory.shaw.dev@gmail.com>2017-08-26 10:34:53 -0400
committerJack Humbert <jack.humb@gmail.com>2017-08-26 10:34:53 -0400
commitb28982e329c790d42369d0669b55128eb89a62f4 (patch)
tree24e696e3af936facb62c6c208255615399dce4dc
parent0965e5203eb5d359816e5141d0be9d523531e5d6 (diff)
downloadqmk_firmware-b28982e329c790d42369d0669b55128eb89a62f4.tar.gz
qmk_firmware-b28982e329c790d42369d0669b55128eb89a62f4.zip
Add mbsurfer Let's Split keymap with RGB layer indicators (#1638)
-rw-r--r--keyboards/lets_split/keymaps/mbsurfer/Makefile7
-rw-r--r--keyboards/lets_split/keymaps/mbsurfer/config.h43
-rw-r--r--keyboards/lets_split/keymaps/mbsurfer/keymap.c248
3 files changed, 298 insertions, 0 deletions
diff --git a/keyboards/lets_split/keymaps/mbsurfer/Makefile b/keyboards/lets_split/keymaps/mbsurfer/Makefile
new file mode 100644
index 000000000..c90523e5d
--- /dev/null
+++ b/keyboards/lets_split/keymaps/mbsurfer/Makefile
@@ -0,0 +1,7 @@
1TAP_DANCE_ENABLE = yes
2RGBLIGHT_ENABLE = yes
3USE_I2C = no
4
5ifndef QUANTUM_DIR
6 include ../../../../Makefile
7endif
diff --git a/keyboards/lets_split/keymaps/mbsurfer/config.h b/keyboards/lets_split/keymaps/mbsurfer/config.h
new file mode 100644
index 000000000..7adde0734
--- /dev/null
+++ b/keyboards/lets_split/keymaps/mbsurfer/config.h
@@ -0,0 +1,43 @@
1/*
2This is the c configuration file for the keymap
3
4Copyright 2012 Jun Wako <wakojun@gmail.com>
5Copyright 2015 Jack Humbert
6
7This program is free software: you can redistribute it and/or modify
8it under the terms of the GNU General Public License as published by
9the Free Software Foundation, either version 2 of the License, or
10(at your option) any later version.
11
12This program is distributed in the hope that it will be useful,
13but WITHOUT ANY WARRANTY; without even the implied warranty of
14MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15GNU General Public License for more details.
16
17You should have received a copy of the GNU General Public License
18along with this program. If not, see <http://www.gnu.org/licenses/>.
19*/
20
21#ifndef CONFIG_USER_H
22#define CONFIG_USER_H
23
24#include "../../config.h"
25
26#define TAPPING_TERM 100
27
28/* Use I2C or Serial, not both */
29
30#define USE_SERIAL
31// #define USE_I2C
32
33/* Select hand configuration */
34
35//#define MASTER_LEFT
36// #define _MASTER_RIGHT
37#define EE_HANDS
38
39#undef RGBLED_NUM
40#define RGBLIGHT_ANIMATIONS
41#define RGBLED_NUM 8
42
43#endif \ No newline at end of file
diff --git a/keyboards/lets_split/keymaps/mbsurfer/keymap.c b/keyboards/lets_split/keymaps/mbsurfer/keymap.c
new file mode 100644
index 000000000..b51abf258
--- /dev/null
+++ b/keyboards/lets_split/keymaps/mbsurfer/keymap.c
@@ -0,0 +1,248 @@
1#include "lets_split.h"
2#include "action_layer.h"
3#include "eeconfig.h"
4
5extern rgblight_config_t rgblight_config;
6extern keymap_config_t keymap_config;
7
8// Each layer gets a name for readability, which is then used in the keymap matrix below.
9// The underscores don't mean anything - you can have a layer called STUFF or any other name.
10// Layer names don't all need to be of the same length, obviously, and you can also skip them
11// entirely and just use numbers.
12#define _QWERTY 0
13#define _COLEMAK 1
14#define _DVORAK 2
15#define _LOWER 3
16#define _RAISE 4
17#define _ADJUST 16
18
19enum custom_keycodes {
20 QWERTY = SAFE_RANGE,
21 COLEMAK,
22 DVORAK,
23 LOWER,
24 RAISE,
25 ADJUST,
26};
27
28// Fillers to make layering more clear
29#define _______ KC_TRNS
30#define XXXXXXX KC_NO
31
32// Tap Dance Declarations
33enum {
34 SFT_CAP = 0,
35 LFT_HOM,
36 DWN_PDN,
37 UPP_PUP,
38 RGT_END
39};
40
41// Task Manager
42#define C_S_ESC LSFT(LCTL(KC_ESC))
43#define C_A_DEL LALT(LCTL(KC_DEL))
44
45const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
46
47/* Qwerty
48 * ,------------------------------------------ ------------------------------------------.
49 * | Tab | Q | W | E | R | T | | Y | U | I | O | P | Bksp |
50 * |------+------+------+------+------+------- -------+------+------+------+------+------|
51 * | Esc | A | S | D | F | G | | H | J | K | L | ; | " |
52 * |------+------+------+------+------+------- -------+------+------+------+------+------|
53 * | Shift| Z | X | C | V | B | | N | M | , | . | / |Enter |
54 * |------+------+------+------+------+------+ +------+------+------+------+------+------|
55* |Adjust| Ctrl | Alt | GUI |Lower |Space | |Space |Raise | Left | Down | Up |Right |
56 * `------------------------------------------ ------------------------------------------'
57 */
58[_QWERTY] = KEYMAP( \
59 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, \
60 CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, \
61 TD(SFT_CAP), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT), \
62 ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, TD(LFT_HOM), TD(DWN_PDN), TD(UPP_PUP), TD(RGT_END) \
63),
64
65/* Colemak
66 * ,------------------------------------------ ------------------------------------------.
67 * | Tab | Q | W | F | P | G | | J | L | U | Y | ; | Bksp |
68 * |------+------+------+------+------+------- -------+------+------+------+------+------|
69 * | Esc | A | R | S | T | D | | H | N | E | I | O | " |
70 * |------+------+------+------+------+------- -------+------+------+------+------+------|
71 * | Shift| Z | X | C | V | B | | K | M | , | . | / |Enter |
72 * |------+------+------+------+------+------+ +------+------+------+------+------+------|
73 * |Adjust| Ctrl | Alt | GUI |Lower |Space | |Space |Raise | Left | Down | Up |Right |
74 * `------------------------------------------ ------------------------------------------'
75 */
76[_COLEMAK] = KEYMAP( \
77 KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, \
78 KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT, \
79 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , \
80 ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
81),
82
83/* Dvorak
84 * ,------------------------------------------ ------------------------------------------.
85 * | Tab | " | , | . | P | Y | | F | G | C | R | L | Bksp |
86 * |------+------+------+------+------+------- -------+------+------+------+------+------|
87 * | Esc | A | O | E | U | I | | D | H | T | N | S | / |
88 * |------+------+------+------+------+------- -------+------+------+------+------+------|
89 * | Shift| ; | Q | J | K | X | | B | M | W | V | Z |Enter |
90 * |------+------+------+------+------+------+ +------+------+------+------+------+------|
91 * |Adjust| Ctrl | Alt | GUI |Lower |Space | |Space |Raise | Left | Down | Up |Right |
92 * `------------------------------------------ ------------------------------------------'
93 */
94[_DVORAK] = KEYMAP( \
95 KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, \
96 KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, \
97 KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , \
98 ADJUST, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT \
99),
100
101/* Lower
102 * ,------------------------------------------ ------------------------------------------.
103 * | ~ | ! | @ | # | $ | % | | ^ | & | * | ( | ) | Bksp |
104 * |------+------+------+------+------+------- -------+------+------+------+------+------|
105 * | Del | F1 | F2 | F3 | F4 | F5 | | F6 | _ | + | { | } | | |
106 * |------+------+------+------+------+------- -------+------+------+------+------+------|
107 * | | F7 | F8 | F9 | F10 | F11 | | F12 |ISO ~ |ISO | | END | HOME |Enter |
108 * |------+------+------+------+------+------+ +------+------+------+------+------+------|
109 * | | | | | | | | | | Next | Vol- | Vol+ | Play |
110 * `------------------------------------------ ------------------------------------------'
111 */
112[_LOWER] = KEYMAP( \
113 KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, \
114 KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, \
115 _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),KC_END, KC_HOME, _______, \
116 _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
117),
118
119/* Raise
120 * ,------------------------------------------ ------------------------------------------.
121 * | ` | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 | Bksp |
122 * |------+------+------+------+------+------- -------+------+------+------+------+------|
123 * | Del | F1 | F2 | F3 | F4 | F5 | | F6 | - | = | [ | ] | \ |
124 * |------+------+------+------+------+------- -------+------+------+------+------+------|
125 * | | F7 | F8 | F9 | F10 | F11 | | F12 |ISO # |ISO / |PG DN |PG UP |Enter |
126 * |------+------+------+------+------+------+ +------+------+------+------+------+------|
127 * | | | | | | | | | | Next | Vol- | Vol+ | Play |
128 * `------------------------------------------ ------------------------------------------'
129 */
130[_RAISE] = KEYMAP( \
131 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \
132 KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, \
133 _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGDN, KC_PGUP, _______, \
134 _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY \
135),
136
137/* Adjust (Lower + Raise)
138 * ,------------------------------------------ ------------------------------------------.
139 * | | Reset| | | | | | | | | | | Del |
140 * |------+------+------+------+------+------- -------+------+------+------+------+------|
141 * | | | |Aud on|Audoff|AGnorm| |AGswap|Qwerty|Colemk|Dvorak| | |
142 * |------+------+------+------+------+------- -------+------+------+------+------+------|
143 * | |Toggle| Mode | Hue- | Hue+ | Sat- | | Sat+ | Val- | Val+ | | | | (RGB)
144 * |------+------+------+------+------+------+ +------+------+------+------+------+------|
145 * | | | | | | | | | | | |TskMng|CAltDe|
146 * `------------------------------------------ ------------------------------------------'
147 */
148[_ADJUST] = KEYMAP( \
149 _______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, \
150 _______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______, \
151 _______, RGB_TOG, RGB_MOD, RGB_HUD, RGB_HUI, RGB_SAD, RGB_SAI, RGB_VAD, RGB_VAI, _______, _______, _______, \
152 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, C_S_ESC, C_A_DEL \
153)
154
155
156};
157
158int RGB_current_mode;
159int RGB_current_hue;
160
161qk_tap_dance_action_t tap_dance_actions[] = {
162 [SFT_CAP] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS),
163 [LFT_HOM] = ACTION_TAP_DANCE_DOUBLE(KC_LEFT, KC_HOME),
164 [DWN_PDN] = ACTION_TAP_DANCE_DOUBLE(KC_DOWN, KC_PGDN),
165 [UPP_PUP] = ACTION_TAP_DANCE_DOUBLE(KC_UP, KC_PGUP),
166 [RGT_END] = ACTION_TAP_DANCE_DOUBLE(KC_RGHT, KC_END)
167};
168
169void persistent_default_layer_set(uint16_t default_layer) {
170 eeconfig_update_default_layer(default_layer);
171 default_layer_set(default_layer);
172}
173
174bool process_record_user(uint16_t keycode, keyrecord_t *record) {
175 switch (keycode) {
176 case QWERTY:
177 if (record->event.pressed) {
178 persistent_default_layer_set(1UL<<_QWERTY);
179 }
180 return false;
181 break;
182 case COLEMAK:
183 if (record->event.pressed) {
184 persistent_default_layer_set(1UL<<_COLEMAK);
185 }
186 return false;
187 break;
188 case DVORAK:
189 if (record->event.pressed) {
190 persistent_default_layer_set(1UL<<_DVORAK);
191 }
192 return false;
193 break;
194 case LOWER:
195 if (record->event.pressed) {
196 layer_on(_LOWER);
197 update_tri_layer(_LOWER, _RAISE, _ADJUST);
198
199 // Save current RGB info
200 RGB_current_mode = rgblight_config.mode;
201 RGB_current_hue = rgblight_config.hue;
202
203 // Set RGB to Blue
204 rgblight_mode(1);
205 rgblight_setrgb(0, 0, 254);
206 } else {
207 layer_off(_LOWER);
208 update_tri_layer(_LOWER, _RAISE, _ADJUST);
209
210 // Reset RGB
211 rgblight_mode(RGB_current_mode);
212 rgblight_sethsv(RGB_current_hue, rgblight_config.sat, rgblight_config.val);
213 }
214 return false;
215 break;
216 case RAISE:
217 if (record->event.pressed) {
218 layer_on(_RAISE);
219 update_tri_layer(_LOWER, _RAISE, _ADJUST);
220
221 // Save current RGB info
222 RGB_current_mode = rgblight_config.mode;
223 RGB_current_hue = rgblight_config.hue;
224
225 // Set RGB to Green
226 rgblight_mode(1);
227 rgblight_setrgb(0, 254, 0);
228 } else {
229 layer_off(_RAISE);
230 update_tri_layer(_LOWER, _RAISE, _ADJUST);
231
232 // Reset RGB
233 rgblight_mode(RGB_current_mode);
234 rgblight_sethsv(RGB_current_hue, rgblight_config.sat, rgblight_config.val);
235 }
236 return false;
237 break;
238 case ADJUST:
239 if (record->event.pressed) {
240 layer_on(_ADJUST);
241 } else {
242 layer_off(_ADJUST);
243 }
244 return false;
245 break;
246 }
247 return true;
248}