aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAbi Shalom <abishalom1997@gmail.com>2020-07-08 15:53:29 -0500
committerGitHub <noreply@github.com>2020-07-08 21:53:29 +0100
commit071e0c2029e7923cbaa6ff721365b2f61cdd08d8 (patch)
tree7c4edc24a5f8132e55f72a19543be0868e6e2ebc
parent2b55c419ea72225030c884ce818a571ef0247b42 (diff)
downloadqmk_firmware-071e0c2029e7923cbaa6ff721365b2f61cdd08d8.tar.gz
qmk_firmware-071e0c2029e7923cbaa6ff721365b2f61cdd08d8.zip
Created abishalom keymap (#9669)
Co-authored-by: Ryan <fauxpark@gmail.com>
-rw-r--r--keyboards/planck/keymaps/abishalom/config.h35
-rw-r--r--keyboards/planck/keymaps/abishalom/keymap.c316
-rw-r--r--keyboards/planck/keymaps/abishalom/readme.md7
-rw-r--r--keyboards/planck/keymaps/abishalom/rules.mk1
4 files changed, 359 insertions, 0 deletions
diff --git a/keyboards/planck/keymaps/abishalom/config.h b/keyboards/planck/keymaps/abishalom/config.h
new file mode 100644
index 000000000..672c5d570
--- /dev/null
+++ b/keyboards/planck/keymaps/abishalom/config.h
@@ -0,0 +1,35 @@
1#pragma once
2
3#ifdef AUDIO_ENABLE
4 #define STARTUP_SONG SONG(PLANCK_SOUND)
5 // #define STARTUP_SONG SONG(NO_SOUND)
6
7 #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \
8 SONG(COLEMAK_SOUND), \
9 SONG(DVORAK_SOUND) \
10 }
11#endif
12
13/*
14 * MIDI options
15 */
16
17/* Prevent use of disabled MIDI features in the keymap */
18//#define MIDI_ENABLE_STRICT 1
19
20/* enable basic MIDI features:
21 - MIDI notes can be sent when in Music mode is on
22*/
23
24#define MIDI_BASIC
25
26/* enable advanced MIDI features:
27 - MIDI notes can be added to the keymap
28 - Octave shift and transpose
29 - Virtual sustain, portamento, and modulation wheel
30 - etc.
31*/
32//#define MIDI_ADVANCED
33
34/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
35//#define MIDI_TONE_KEYCODE_OCTAVES 2
diff --git a/keyboards/planck/keymaps/abishalom/keymap.c b/keyboards/planck/keymaps/abishalom/keymap.c
new file mode 100644
index 000000000..4c1185ad9
--- /dev/null
+++ b/keyboards/planck/keymaps/abishalom/keymap.c
@@ -0,0 +1,316 @@
1/* Copyright 2015-2017 Jack Humbert
2 *
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.
7 *
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.
12 *
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/>.
15 */
16
17#include QMK_KEYBOARD_H
18#include "muse.h"
19
20
21enum planck_layers {
22 _QWERTY,
23 _LOWER,
24 _RAISE,
25 _NAV,
26 _PLOVER,
27 _ADJUST
28};
29
30enum planck_keycodes {
31 QWERTY = SAFE_RANGE,
32 PLOVER,
33 BACKLIT,
34 EXT_PLV
35};
36
37#define LOWER MO(_LOWER)
38#define RAISE MO(_RAISE)
39
40const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
41
42/* Qwerty
43 * ,-----------------------------------------------------------------------------------.
44 * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
45 * |------+------+------+------+------+------+------+------+------+------+------+------|
46 * | Esc | A | S | D | F | G | H | J | K | L | ; | " |
47 * |------+------+------+------+------+------+------+------+------+------+------+------|
48 * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
49 * |------+------+------+------+------+------+------+------+------+------+------+------|
50 * | Ctrl| CAPS | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
51 * `-----------------------------------------------------------------------------------'
52 */
53[_QWERTY] = LAYOUT_planck_grid(
54 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
55 LT(_NAV, KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
56 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT ,
57 KC_LCTL, KC_CAPS, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
58),
59
60
61/* Lower
62 * ,-----------------------------------------------------------------------------------.
63 * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp |
64 * |------+------+------+------+------+------+------+------+------+------+------+------|
65 * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | |
66 * |------+------+------+------+------+------+------+------+------+------+------+------|
67 * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End |Pl/Ps |
68 * |------+------+------+------+------+------+------+------+------+------+------+------|
69 * | | | | | | | | Prev | Vol- | Vol+ | Next |
70 * `-----------------------------------------------------------------------------------'
71 */
72[_LOWER] = LAYOUT_planck_grid(
73 KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC,
74 KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE,
75 _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, KC_MPLY,
76 _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT
77),
78
79/* Raise
80 * ,-----------------------------------------------------------------------------------.
81 * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
82 * |------+------+------+------+------+------+------+------+------+------+------+------|
83 * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ |
84 * |------+------+------+------+------+------+------+------+------+------+------+------|
85 * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn |Pl/Ps |
86 * |------+------+------+------+------+------+------+------+------+------+------+------|
87 * | | | | | | | | Prev | Vol- | Vol+ | Next |
88 * `-----------------------------------------------------------------------------------'
89 */
90[_RAISE] = LAYOUT_planck_grid(
91 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
92 KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS,
93 _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, KC_MPLY,
94 _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT
95),
96
97/* Nav
98 * ,----------------------------------l-------------------------------------------------.
99 * | | | | | | | | Pg Dn| Up | Pg Up| | |
100 * |------+------+------+------+------+------+------+------+------+------+------+------|
101 * | | Mute | Vol-| Vol+ | Pl/Ps| | | Left | Down | Right| | |
102 * |------+------+------+------+------+------+------+------+------+------+------+------|
103 * | | | | | | | | | | | | |
104 * |------+------+------+------+------+------+------+------+------+------+------+------|
105 * | | | | | | | | | | | |
106 * `-----------------------------------------------------------------------------------'
107 */
108[_NAV] = LAYOUT_planck_grid(
109 _______, _______, _______, _______, _______, _______, _______, KC_PGDOWN, KC_UP, KC_PGUP, _______ , _______,
110 _______, KC_MUTE, KC_VOLD, KC_VOLU, KC_MPLY, _______, _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______,
111 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MPLY,
112 _______, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT
113),
114
115
116/* Plover layer (http://opensteno.org)
117 * ,-----------------------------------------------------------------------------------.
118 * | # | # | # | # | # | # | # | # | # | # | # | # |
119 * |------+------+------+------+------+------+------+------+------+------+------+------|
120 * | | S | T | P | H | * | * | F | P | L | T | D |
121 * |------+------+------+------+------+------+------+------+------+------+------+------|
122 * | | S | K | W | R | * | * | R | B | G | S | Z |
123 * |------+------+------+------+------+------+------+------+------+------+------+------|
124 * | Exit | | | A | O | | E | U | | | |
125 * `-----------------------------------------------------------------------------------'
126 */
127[_PLOVER] = LAYOUT_planck_grid(
128 KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 ,
129 XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,
130 XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
131 EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX
132),
133
134/* Adjust (Lower + Raise)
135 * v------------------------RGB CONTROL--------------------v
136 * ,-----------------------------------------------------------------------------------.
137 * | | Reset|Debug | RGB |RGBMOD| HUE+ | HUE- | SAT+ | SAT- |BRGTH+|BRGTH-| Del |
138 * |------+------+------+------+------+------+------+------+------+------+------+------|
139 * | | |MUSmod|Aud on|Audoff|AGnorm|AGswap|Qwerty| | |Plover| |
140 * |------+------+------+------+------+------+------+------+------+------+------+------|
141 * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof|TermOn|TermOf| | | |
142 * |------+------+------+------+------+------+------+------+------+------+------+------|
143 * | | | | | | | | | | | |
144 * `-----------------------------------------------------------------------------------'
145 */
146[_ADJUST] = LAYOUT_planck_grid(
147 _______, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL ,
148 _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, _______, _______, PLOVER, _______,
149 _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______,
150 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
151)
152
153};
154
155#ifdef AUDIO_ENABLE
156 float plover_song[][2] = SONG(PLOVER_SOUND);
157 float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND);
158#endif
159
160layer_state_t layer_state_set_user(layer_state_t state) {
161 return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
162}
163
164bool process_record_user(uint16_t keycode, keyrecord_t *record) {
165 switch (keycode) {
166 case QWERTY:
167 if (record->event.pressed) {
168 print("mode just switched to qwerty and this is a huge string\n");
169 set_single_persistent_default_layer(_QWERTY);
170 }
171 return false;
172 case BACKLIT:
173 if (record->event.pressed) {
174 register_code(KC_RSFT);
175 #ifdef BACKLIGHT_ENABLE
176 backlight_step();
177 #endif
178 #ifdef KEYBOARD_planck_rev5
179 writePinLow(E6);
180 #endif
181 } else {
182 unregister_code(KC_RSFT);
183 #ifdef KEYBOARD_planck_rev5
184 writePinHigh(E6);
185 #endif
186 }
187 return false;
188 case PLOVER:
189 if (record->event.pressed) {
190 #ifdef AUDIO_ENABLE
191 stop_all_notes();
192 PLAY_SONG(plover_song);
193 #endif
194 layer_off(_RAISE);
195 layer_off(_LOWER);
196 layer_off(_ADJUST);
197 layer_on(_PLOVER);
198 if (!eeconfig_is_enabled()) {
199 eeconfig_init();
200 }
201 keymap_config.raw = eeconfig_read_keymap();
202 keymap_config.nkro = 1;
203 eeconfig_update_keymap(keymap_config.raw);
204 }
205 return false;
206 case EXT_PLV:
207 if (record->event.pressed) {
208 #ifdef AUDIO_ENABLE
209 PLAY_SONG(plover_gb_song);
210 #endif
211 layer_off(_PLOVER);
212 }
213 return false;
214 }
215 return true;
216}
217
218bool muse_mode = false;
219uint8_t last_muse_note = 0;
220uint16_t muse_counter = 0;
221uint8_t muse_offset = 70;
222uint16_t muse_tempo = 50;
223
224void encoder_update(bool clockwise) {
225 if (muse_mode) {
226 if (IS_LAYER_ON(_RAISE)) {
227 if (clockwise) {
228 muse_offset++;
229 } else {
230 muse_offset--;
231 }
232 } else {
233 if (clockwise) {
234 muse_tempo+=1;
235 } else {
236 muse_tempo-=1;
237 }
238 }
239 } else {
240 if (clockwise) {
241 #ifdef MOUSEKEY_ENABLE
242 tap_code(KC_MS_WH_DOWN);
243 #else
244 tap_code(KC_PGDN);
245 #endif
246 } else {
247 #ifdef MOUSEKEY_ENABLE
248 tap_code(KC_MS_WH_UP);
249 #else
250 tap_code(KC_PGUP);
251 #endif
252 }
253 }
254}
255
256void dip_switch_update_user(uint8_t index, bool active) {
257 switch (index) {
258 case 0: {
259#ifdef AUDIO_ENABLE
260 static bool play_sound = false;
261#endif
262 if (active) {
263#ifdef AUDIO_ENABLE
264 if (play_sound) { PLAY_SONG(plover_song); }
265#endif
266 layer_on(_ADJUST);
267 } else {
268#ifdef AUDIO_ENABLE
269 if (play_sound) { PLAY_SONG(plover_gb_song); }
270#endif
271 layer_off(_ADJUST);
272 }
273#ifdef AUDIO_ENABLE
274 play_sound = true;
275#endif
276 break;
277 }
278 case 1:
279 if (active) {
280 muse_mode = true;
281 } else {
282 muse_mode = false;
283 }
284 }
285}
286
287void matrix_scan_user(void) {
288#ifdef AUDIO_ENABLE
289 if (muse_mode) {
290 if (muse_counter == 0) {
291 uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()];
292 if (muse_note != last_muse_note) {
293 stop_note(compute_freq_for_midi_note(last_muse_note));
294 play_note(compute_freq_for_midi_note(muse_note), 0xF);
295 last_muse_note = muse_note;
296 }
297 }
298 muse_counter = (muse_counter + 1) % muse_tempo;
299 } else {
300 if (muse_counter) {
301 stop_all_notes();
302 muse_counter = 0;
303 }
304 }
305#endif
306}
307
308bool music_mask_user(uint16_t keycode) {
309 switch (keycode) {
310 case RAISE:
311 case LOWER:
312 return false;
313 default:
314 return true;
315 }
316}
diff --git a/keyboards/planck/keymaps/abishalom/readme.md b/keyboards/planck/keymaps/abishalom/readme.md
new file mode 100644
index 000000000..9978df19b
--- /dev/null
+++ b/keyboards/planck/keymaps/abishalom/readme.md
@@ -0,0 +1,7 @@
1# Abishalom Planck Layout
2
3Mostly the same as default. Changes:
4- Get rid of COLEMAK and DVORAK layers
5- Add new layer (NAV) which is accessed by holding the ESC key. This brings up arrow keys in ijkl spots, along with handy media funcions in wasd.
6- Move left control to the corner, put caps lock between LCTRL and LGUI
7- Adjustments to media keys in bottom right corner \ No newline at end of file
diff --git a/keyboards/planck/keymaps/abishalom/rules.mk b/keyboards/planck/keymaps/abishalom/rules.mk
new file mode 100644
index 000000000..dcf16bef3
--- /dev/null
+++ b/keyboards/planck/keymaps/abishalom/rules.mk
@@ -0,0 +1 @@
SRC += muse.c