aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorChristoffer Holmberg <mr.skug@gmail.com>2018-08-21 18:37:29 +0300
committerDrashna Jaelre <drashna@live.com>2018-08-21 08:37:29 -0700
commit220ea4c9b7acefa45fd0c58d58f4e79f07dace0f (patch)
tree86babdf76804920308625f646ba6f9c02b20cc83
parentdbef2ad6b9ba9a347dfebee0eed07b5b02e3c564 (diff)
downloadqmk_firmware-220ea4c9b7acefa45fd0c58d58f4e79f07dace0f.tar.gz
qmk_firmware-220ea4c9b7acefa45fd0c58d58f4e79f07dace0f.zip
Keymap: Nordic layouts for ErgoDox, Planck (#3693)
* first verion of skug * zudvp layer added and new thumb cluster * move del to arrw cluster and switch places of algr and no_circ * first verion of skug * zudvp layer added and new thumb cluster * move del to arrw cluster and switch places of algr and no_circ * rework layouts * Adds SYMB layer toggle to 'ä' Closes #2 Also moves ctrl away from '-' and 'z' to the outer bottom corners and removes redundant SYMB layer binds from there * Adds mouse movement to right hand on ARRW layer Closes #3 * Fix typoed keycodes * planck qwerty nordic * Update README.md * Update README.md * Implemented changes to planck layout requested by drashna * Implemented changes to ergodox layout requested by drashna NOTE: `version.h` is still required.
-rw-r--r--keyboards/ergodox_ez/keymaps/skug/config.h6
-rw-r--r--keyboards/ergodox_ez/keymaps/skug/keymap.c275
-rw-r--r--keyboards/ergodox_ez/keymaps/skug/readme.md4
-rw-r--r--keyboards/planck/keymaps/skug/config.h39
-rw-r--r--keyboards/planck/keymaps/skug/keymap.c338
-rw-r--r--keyboards/planck/keymaps/skug/readme.md3
-rw-r--r--keyboards/planck/keymaps/skug/rules.mk1
7 files changed, 666 insertions, 0 deletions
diff --git a/keyboards/ergodox_ez/keymaps/skug/config.h b/keyboards/ergodox_ez/keymaps/skug/config.h
new file mode 100644
index 000000000..d97281392
--- /dev/null
+++ b/keyboards/ergodox_ez/keymaps/skug/config.h
@@ -0,0 +1,6 @@
1#pragma once
2
3#undef LSPO_KEY
4#undef RSPC_KEY
5#define LSPO_KEY KC_8 // Nordic Left SpaceCadet
6#define RSPC_KEY KC_9 // Nordic Right SpaceCadet
diff --git a/keyboards/ergodox_ez/keymaps/skug/keymap.c b/keyboards/ergodox_ez/keymaps/skug/keymap.c
new file mode 100644
index 000000000..0d2ec1dd9
--- /dev/null
+++ b/keyboards/ergodox_ez/keymaps/skug/keymap.c
@@ -0,0 +1,275 @@
1/* Copyright 2018 Andreas Lindhé, Christoffer Holmberg
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
18
19
20
21#include QMK_KEYBOARD_H
22#include "version.h"
23#include "keymap_swedish.h"
24
25#define _______ KC_TRNS
26
27#define BASE 0 // default layer
28#define SYMB 1 // symbols
29#define MDIA 2 // media keys
30#define ARRW 3 // arrow + soon mouse
31
32enum custom_keycodes {
33 PLACEHOLDER = SAFE_RANGE, // can always be here
34 EPRM,
35 VRSN,
36 RGB_SLD
37};
38
39const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
40/* Keymap 0: Basic layer
41 *
42 * ,--------------------------------------------------. ,--------------------------------------------------.
43 * | ½ | ! | " | # | # | % | Ins | | L1 | & | / | ( | ) | = | ? |
44 * | § | 1 | 2 @ | 3 £ | 4 $ | 5 | | | | 6 | 7 { | 8 [ | 9 ] | 0 } | + \ |
45 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
46 * | Tab | Q | W | E | R | T | L2 | | L2 | Y | U | I | O | P | Å |
47 * | | | | | | | | | | | | | | | |
48 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
49 * | L4 | A | S | D | F | G |------| |------| H | J | K | L |Ö / L3| Ä/L2 |
50 * | | | | | | | Hypr/| | Meh/ | | | | | | |
51 * |--------+------+------+------+------+------| Esc | | Ent |------+------+------+------+------+--------|
52 * | LShift/| Z | X | C | V | B | | | | N | M | ; | : | _ | RShift/|
53 * | ( | | | | | | | | | | | , | . | - | ) |
54 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
55 * | '/ | ` |Alt | Left | Right| | Spc | Bksp | AltGr| * | ~/ |
56 * | Ctrl | ' | | | | | | | | | Ctrl |
57 * `----------------------------------' `----------------------------------'
58 * ,-------------. ,---------------.
59 * | <>| | End | | Home | ^ |
60 * ,------|------|------| |------+--------+------.
61 * | Left | Right| PgDn | | PgUp | Up | Down |
62 * |------|------|------| |------|--------|------|
63 * | Ctrl/| Alt/ | | | | Alt/ | Ctrl/|
64 * | Enter| Esc | Lgui | | Lgui | Esc | Enter|
65 * `--------------------' `----------------------'
66 */
67// If it accepts an argument (i.e, is a function), it doesn't need KC_
68// Otherwise, it needs KC_*
69[BASE] = LAYOUT_ergodox_80( // layer 0 : default
70 // left hand
71 NO_HALF, KC_1, KC_2, KC_3, KC_4, KC_5, KC_INS,
72 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, TG(SYMB),
73 MO(ARRW), KC_A, KC_S, KC_D, KC_F, KC_G,
74 KC_LSPO, CTL_T(KC_Z), KC_X, KC_C, KC_V, KC_B, ALL_T(KC_ESC),
75 CTL_T(NO_APOS), NO_ACUT, KC_LALT, KC_BSPC, KC_SPC,
76 NO_LESS, KC_END,
77 KC_LEFT, KC_RIGHT, KC_PGDN,
78 CTL_T(KC_ENT), ALT_T(KC_ESC), KC_LGUI,
79
80 // right hand
81 TO(ARRW), KC_6, KC_7, KC_8, KC_9, KC_0, NO_PLUS,
82 TG(SYMB), KC_Y, KC_U, KC_I, KC_O, KC_P, NO_AA,
83 KC_H, KC_J, KC_K, KC_L, LT(MDIA, NO_OSLH), LT(SYMB, NO_AE),
84 MEH_T(KC_ENT), KC_N, KC_M, KC_COMM, KC_DOT, NO_MINS, KC_RSPC,
85 KC_SPC, KC_BSPC, NO_ALGR, NO_ASTR, CTL_T(NO_TILD),
86 KC_HOME, NO_CIRC,
87 KC_PGUP, KC_UP, KC_DOWN,
88 KC_LGUI, ALT_T(KC_ESC), CTL_T(KC_ENT)
89),
90/* Keymap: Symbol Layer
91 *
92 * ,--------------------------------------------------. ,--------------------------------------------------.
93 * |Version | F1 | F2 | F3 | F4 | F5 | | | | F6 | F7 | F8 | F9 | F10 | F11 |
94 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
95 * | | ! | @ | { | } | | | | | | Up | 7 | 8 | 9 | * | F12 |
96 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
97 * | | # | $ | ( | ) | ` |------| |------| Down | 4 | 5 | 6 | + | |
98 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
99 * | | % | ^ | [ | ] | ~ | | | | & | 1 | 2 | 3 | - | |
100 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
101 * | | | | | | | | . | 0 | = | |
102 * `----------------------------------' `----------------------------------'
103 * ,-------------. ,-------------.
104 * |Animat| | |Toggle|Solid |
105 * ,------|------|------| |------+------+------.
106 * | | | | | | | |
107 * |------|------|------| |------|------|------|
108 * |BNess-|Bness+| | | |Hue- |Hue+ |
109 * `--------------------' `--------------------'
110 */
111// SYMBOLS
112[SYMB] = LAYOUT_ergodox_80(
113 // left hand
114 VRSN, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, _______,
115 _______,KC_EXLM,NO_AT, NO_LCBR,NO_RCBR,NO_PIPE,_______,
116 _______,KC_HASH,NO_DLR, NO_LPRN,NO_RPRN,NO_GRV,
117 _______,KC_PERC,NO_CIRC,NO_LBRC,NO_RBRC,NO_TILD,_______,
118 EPRM,_______,_______,_______,_______,
119 RGB_MOD,_______,
120 _______,_______,_______,
121 RGB_VAD,RGB_VAI,_______,
122 // right hand
123 _______, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
124 _______, KC_UP, KC_7, KC_8, KC_9, NO_ASTR, KC_F12,
125 KC_DOWN, KC_4, KC_5, KC_6, NO_PLUS, _______,
126 _______, NO_AMPR, KC_1, KC_2, KC_3, NO_MINS, _______,
127 _______,KC_DOT, KC_0, NO_EQL, _______,
128 RGB_TOG, RGB_SLD,
129 _______, _______, _______,
130 _______, RGB_HUD, RGB_HUI
131),
132
133/* Keymap: Media and mouse keys
134 *
135 * ,--------------------------------------------------. ,--------------------------------------------------.
136 * | | | | | | | | | | | | | | | |
137 * |--------+------+------+------+------+-------------| |------+------+------+------+------+------+--------|
138 * | | | MsUp | | | | | | | | | | | | |
139 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
140 * | |MsLeft|MsDown|MsRght| | |------| |------| | | | | | Play |
141 * |--------+------+------+------+------+------| | | |------+------+------+------+------+--------|
142 * | | | | | | | | | | | | Prev | Next | | |
143 * `--------+------+------+------+------+-------------' `-------------+------+------+------+------+--------'
144 * | | | | Lclk | Rclk | |VolUp |VolDn | Mute | | |
145 * `----------------------------------' `----------------------------------'
146 * ,-------------. ,-------------.
147 * | | | | | |
148 * ,------|------|------| |------+------+------.
149 * | | | | | | | |
150 * | |------|------| |------|------|------|
151 * | | | | | | |BrBck |
152 * `--------------------' `--------------------'
153 */
154// MEDIA AND MOUSE
155[MDIA] = LAYOUT_ergodox_80(
156 _______, _______, _______, _______, _______, _______, _______,
157 _______, _______, KC_MS_U, _______, _______, _______, _______,
158 _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______,
159 _______, _______, _______, _______, _______, _______, _______,
160 _______, _______, _______, KC_BTN1, KC_BTN2,
161 _______, _______,
162 _______, _______, _______,
163 _______, _______, _______,
164 // right hand
165 _______, _______, _______, _______, _______, _______, _______,
166 _______, _______, _______, _______, _______, _______, _______,
167 _______, _______, _______, _______, _______, KC_MPLY,
168 _______, _______, _______, KC_MPRV, KC_MNXT, _______, _______,
169 KC_VOLU, KC_VOLD, KC_MUTE, _______, _______,
170 _______, _______,
171 _______, _______, _______,
172 _______, _______, KC_WBAK
173),
174 // Keymap: Ducky Style arrows
175[ARRW] = LAYOUT_ergodox_80(
176 _______, _______, _______, _______, _______, _______, _______,
177 _______, _______, KC_UP , _______, _______, _______, _______,
178 _______, KC_LEFT, KC_DOWN, KC_RIGHT, _______, _______,
179 _______, _______, _______, _______, _______, _______, _______,
180 _______, _______, _______, KC_DEL, _______,
181 _______, _______,
182 _______, _______, _______,
183 _______, _______, _______,
184 // right hand
185 TO(BASE), _______, _______, _______, _______, _______, _______,
186 _______, _______, KC_BTN4, KC_MS_U, KC_BTN5, _______, _______,
187 _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______,
188 _______, _______, _______, _______, _______, _______, _______,
189 KC_BTN1, KC_BTN3, KC_BTN2, _______, _______,
190 _______, _______,
191 _______, _______, _______,
192 _______, _______, _______
193),
194
195};
196
197const uint16_t PROGMEM fn_actions[] = {
198 [1] = ACTION_LAYER_TAP_TOGGLE(SYMB) // FN1 - Momentary Layer 1 (Symbols)
199};
200
201const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
202{
203 // MACRODOWN only works in this function
204 switch(id) {
205 case 0:
206 if (record->event.pressed) {
207 SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
208 }
209 break;
210 case 1:
211 if (record->event.pressed) { // For resetting EEPROM
212 eeconfig_init();
213 }
214 break;
215 }
216 return MACRO_NONE;
217};
218
219bool process_record_user(uint16_t keycode, keyrecord_t *record) {
220 switch (keycode) {
221 // dynamically generate these.
222 case EPRM:
223 if (record->event.pressed) {
224 eeconfig_init();
225 }
226 return false;
227 break;
228 case VRSN:
229 if (record->event.pressed) {
230 SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
231 }
232 return false;
233 break;
234 case RGB_SLD:
235 if (record->event.pressed) {
236 #ifdef RGBLIGHT_ENABLE
237 rgblight_mode(1);
238 #endif
239 }
240 return false;
241 break;
242 }
243 return true;
244}
245
246// Runs just one time when the keyboard initializes.
247void matrix_init_user(void) {
248
249};
250
251
252// Runs constantly in the background, in a loop.
253void matrix_scan_user(void) {
254
255 uint8_t layer = biton32(layer_state);
256
257 ergodox_board_led_off();
258 ergodox_right_led_1_off();
259 ergodox_right_led_2_off();
260 ergodox_right_led_3_off();
261 switch (layer) {
262 // Binary: lsb at bottom
263 case 1:
264 ergodox_right_led_3_on();
265 break;
266 case 2:
267 ergodox_right_led_2_on();
268 break;
269 case 3:
270 ergodox_board_led_on();
271 default:
272 // none
273 break;
274 }
275};
diff --git a/keyboards/ergodox_ez/keymaps/skug/readme.md b/keyboards/ergodox_ez/keymaps/skug/readme.md
new file mode 100644
index 000000000..5c155619c
--- /dev/null
+++ b/keyboards/ergodox_ez/keymaps/skug/readme.md
@@ -0,0 +1,4 @@
1# Nordic Qwerty layout for ErgoDox EZ, based on Andreas Lindhe's version
2
3*NOTE:* it might still be desirable to set the software layout to sv_SE in your
4OS.
diff --git a/keyboards/planck/keymaps/skug/config.h b/keyboards/planck/keymaps/skug/config.h
new file mode 100644
index 000000000..0a1d8d289
--- /dev/null
+++ b/keyboards/planck/keymaps/skug/config.h
@@ -0,0 +1,39 @@
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
12/*
13 * MIDI options
14 */
15
16/* Prevent use of disabled MIDI features in the keymap */
17//#define MIDI_ENABLE_STRICT 1
18
19/* enable basic MIDI features:
20 - MIDI notes can be sent when in Music mode is on
21*/
22
23#define MIDI_BASIC
24
25/* enable advanced MIDI features:
26 - MIDI notes can be added to the keymap
27 - Octave shift and transpose
28 - Virtual sustain, portamento, and modulation wheel
29 - etc.
30*/
31//#define MIDI_ADVANCED
32
33/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
34//#define MIDI_TONE_KEYCODE_OCTAVES 2
35
36// Most tactile encoders have detents every 4 stages
37#define ENCODER_RESOLUTION 4
38
39#endif
diff --git a/keyboards/planck/keymaps/skug/keymap.c b/keyboards/planck/keymaps/skug/keymap.c
new file mode 100644
index 000000000..00b2ab21c
--- /dev/null
+++ b/keyboards/planck/keymaps/skug/keymap.c
@@ -0,0 +1,338 @@
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
20extern keymap_config_t keymap_config;
21
22enum planck_layers {
23 _QWERTY,
24 _COLEMAK,
25 _DVORAK,
26 _LOWER,
27 _RAISE,
28 _PLOVER,
29 _ADJUST
30};
31
32enum planck_keycodes {
33 QWERTY = SAFE_RANGE,
34 COLEMAK,
35 DVORAK,
36 PLOVER,
37 BACKLIT,
38 EXT_PLV
39};
40
41#define LOWER MO(_LOWER)
42#define RAISE MO(_RAISE)
43
44const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
45
46/* Qwerty
47 * ,-----------------------------------------------------------------------------------.
48 * | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
49 * |------+------+------+------+------+-------------+------+------+------+------+------|
50 * | Esc | A | S | D | F | G | H | J | K | L | ; | " |
51 * |------+------+------+------+------+------|------+------+------+------+------+------|
52 * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
53 * |------+------+------+------+------+------+------+------+------+------+------+------|
54 * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
55 * `-----------------------------------------------------------------------------------'
56 */
57[_QWERTY] = LAYOUT_planck_grid(
58 KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
59 KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
60 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT ,
61 BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
62),
63
64/* Colemak
65 * ,-----------------------------------------------------------------------------------.
66 * | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp |
67 * |------+------+------+------+------+-------------+------+------+------+------+------|
68 * | Esc | A | R | S | T | D | H | N | E | I | O | " |
69 * |------+------+------+------+------+------|------+------+------+------+------+------|
70 * | Shift| Z | X | C | V | B | K | M | , | . | / |Enter |
71 * |------+------+------+------+------+------+------+------+------+------+------+------|
72 * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
73 * `-----------------------------------------------------------------------------------'
74 */
75[_COLEMAK] = LAYOUT_planck_grid(
76 KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC,
77 KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT,
78 KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT ,
79 BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
80),
81
82/* Dvorak
83 * ,-----------------------------------------------------------------------------------.
84 * | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp |
85 * |------+------+------+------+------+-------------+------+------+------+------+------|
86 * | Esc | A | O | E | U | I | D | H | T | N | S | / |
87 * |------+------+------+------+------+------|------+------+------+------+------+------|
88 * | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter |
89 * |------+------+------+------+------+------+------+------+------+------+------+------|
90 * | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
91 * `-----------------------------------------------------------------------------------'
92 */
93[_DVORAK] = LAYOUT_planck_grid(
94 KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC,
95 KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH,
96 KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT ,
97 BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
98),
99
100/* Lower
101 * ,-----------------------------------------------------------------------------------.
102 * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp |
103 * |------+------+------+------+------+-------------+------+------+------+------+------|
104 * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | |
105 * |------+------+------+------+------+------|------+------+------+------+------+------|
106 * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | |
107 * |------+------+------+------+------+------+------+------+------+------+------+------|
108 * | | | | | | | | Next | Vol- | Vol+ | Play |
109 * `-----------------------------------------------------------------------------------'
110 */
111[_LOWER] = LAYOUT_planck_grid(
112 KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC,
113 KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE,
114 _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______,
115 _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
116),
117
118/* Raise
119 * ,-----------------------------------------------------------------------------------.
120 * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
121 * |------+------+------+------+------+-------------+------+------+------+------+------|
122 * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ |
123 * |------+------+------+------+------+------|------+------+------+------+------+------|
124 * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | |
125 * |------+------+------+------+------+------+------+------+------+------+------+------|
126 * | | | | | | | | Next | Vol- | Vol+ | Play |
127 * `-----------------------------------------------------------------------------------'
128 */
129[_RAISE] = LAYOUT_planck_grid(
130 KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
131 KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS,
132 _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______,
133 _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
134),
135
136/* Plover layer (http://opensteno.org)
137 * ,-----------------------------------------------------------------------------------.
138 * | # | # | # | # | # | # | # | # | # | # | # | # |
139 * |------+------+------+------+------+-------------+------+------+------+------+------|
140 * | | S | T | P | H | * | * | F | P | L | T | D |
141 * |------+------+------+------+------+------|------+------+------+------+------+------|
142 * | | S | K | W | R | * | * | R | B | G | S | Z |
143 * |------+------+------+------+------+------+------+------+------+------+------+------|
144 * | Exit | | | A | O | | E | U | | | |
145 * `-----------------------------------------------------------------------------------'
146 */
147
148[_PLOVER] = LAYOUT_planck_grid(
149 KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 ,
150 XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,
151 XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
152 EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX
153),
154
155/* Adjust (Lower + Raise)
156 * ,-----------------------------------------------------------------------------------.
157 * | | Reset| | | | | | | | | | Del |
158 * |------+------+------+------+------+-------------+------+------+------+------+------|
159 * | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| |
160 * |------+------+------+------+------+------|------+------+------+------+------+------|
161 * | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | |
162 * |------+------+------+------+------+------+------+------+------+------+------+------|
163 * | | | | | | | | | | | |
164 * `-----------------------------------------------------------------------------------'
165 */
166[_ADJUST] = LAYOUT_planck_grid(
167 _______, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL ,
168 _______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______,
169 _______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______,
170 _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
171)
172
173
174};
175
176#ifdef AUDIO_ENABLE
177 float plover_song[][2] = SONG(PLOVER_SOUND);
178 float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND);
179#endif
180
181uint32_t layer_state_set_user(uint32_t state) {
182 return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
183}
184
185bool process_record_user(uint16_t keycode, keyrecord_t *record) {
186 switch (keycode) {
187 case QWERTY:
188 if (record->event.pressed) {
189 print("mode just switched to qwerty and this is a huge string\n");
190 set_single_persistent_default_layer(_QWERTY);
191 }
192 return false;
193 break;
194 case COLEMAK:
195 if (record->event.pressed) {
196 set_single_persistent_default_layer(_COLEMAK);
197 }
198 return false;
199 break;
200 case DVORAK:
201 if (record->event.pressed) {
202 set_single_persistent_default_layer(_DVORAK);
203 }
204 return false;
205 break;
206 case BACKLIT:
207 if (record->event.pressed) {
208 register_code(KC_RSFT);
209 #ifdef BACKLIGHT_ENABLE
210 backlight_step();
211 #endif
212 #ifdef KEYBOARD_planck_rev5
213 PORTE &= ~(1<<6);
214 #endif
215 } else {
216 unregister_code(KC_RSFT);
217 #ifdef KEYBOARD_planck_rev5
218 PORTE |= (1<<6);
219 #endif
220 }
221 return false;
222 break;
223 case PLOVER:
224 if (record->event.pressed) {
225 #ifdef AUDIO_ENABLE
226 stop_all_notes();
227 PLAY_SONG(plover_song);
228 #endif
229 layer_off(_RAISE);
230 layer_off(_LOWER);
231 layer_off(_ADJUST);
232 layer_on(_PLOVER);
233 if (!eeconfig_is_enabled()) {
234 eeconfig_init();
235 }
236 keymap_config.raw = eeconfig_read_keymap();
237 keymap_config.nkro = 1;
238 eeconfig_update_keymap(keymap_config.raw);
239 }
240 return false;
241 break;
242 case EXT_PLV:
243 if (record->event.pressed) {
244 #ifdef AUDIO_ENABLE
245 PLAY_SONG(plover_gb_song);
246 #endif
247 layer_off(_PLOVER);
248 }
249 return false;
250 break;
251 }
252 return true;
253}
254
255bool muse_mode = false;
256uint8_t last_muse_note = 0;
257uint16_t muse_counter = 0;
258uint8_t muse_offset = 70;
259uint16_t muse_tempo = 50;
260
261void encoder_update(bool clockwise) {
262 if (muse_mode) {
263 if (IS_LAYER_ON(_RAISE)) {
264 if (clockwise) {
265 muse_offset++;
266 } else {
267 muse_offset--;
268 }
269 } else {
270 if (clockwise) {
271 muse_tempo+=1;
272 } else {
273 muse_tempo-=1;
274 }
275 }
276 } else {
277 if (clockwise) {
278 register_code(KC_PGDN);
279 unregister_code(KC_PGDN);
280 } else {
281 register_code(KC_PGUP);
282 unregister_code(KC_PGUP);
283 }
284 }
285}
286
287void dip_update(uint8_t index, bool active) {
288 switch (index) {
289 case 0:
290 if (active) {
291 #ifdef AUDIO_ENABLE
292 PLAY_SONG(plover_song);
293 #endif
294 layer_on(_ADJUST);
295 } else {
296 #ifdef AUDIO_ENABLE
297 PLAY_SONG(plover_gb_song);
298 #endif
299 layer_off(_ADJUST);
300 }
301 break;
302 case 1:
303 if (active) {
304 muse_mode = true;
305 } else {
306 muse_mode = false;
307 #ifdef AUDIO_ENABLE
308 stop_all_notes();
309 #endif
310 }
311 }
312}
313
314void matrix_scan_user(void) {
315 #ifdef AUDIO_ENABLE
316 if (muse_mode) {
317 if (muse_counter == 0) {
318 uint8_t muse_note = muse_offset + SCALE[muse_clock_pulse()];
319 if (muse_note != last_muse_note) {
320 stop_note(compute_freq_for_midi_note(last_muse_note));
321 play_note(compute_freq_for_midi_note(muse_note), 0xF);
322 last_muse_note = muse_note;
323 }
324 }
325 muse_counter = (muse_counter + 1) % muse_tempo;
326 }
327 #endif
328}
329
330bool music_mask_user(uint16_t keycode) {
331 switch (keycode) {
332 case RAISE:
333 case LOWER:
334 return false;
335 default:
336 return true;
337 }
338}
diff --git a/keyboards/planck/keymaps/skug/readme.md b/keyboards/planck/keymaps/skug/readme.md
new file mode 100644
index 000000000..259b52f86
--- /dev/null
+++ b/keyboards/planck/keymaps/skug/readme.md
@@ -0,0 +1,3 @@
1# Nordic Planck
2
3TODO: Add layout image
diff --git a/keyboards/planck/keymaps/skug/rules.mk b/keyboards/planck/keymaps/skug/rules.mk
new file mode 100644
index 000000000..dcf16bef3
--- /dev/null
+++ b/keyboards/planck/keymaps/skug/rules.mk
@@ -0,0 +1 @@
SRC += muse.c