Keymap: Reworked layout (#4133)

* Reworked layout

* Remove redundant defines

https://github.com/qmk/qmk_firmware/pull/4133#discussion_r224977420

* fix typo
pull/4157/head 0.6.141
Christoffer Holmberg 6 years ago committed by Drashna Jaelre
parent 47e29754c2
commit 64459fedbf

@ -1,13 +1,20 @@
#pragma once #pragma once
// Override SpaceCadet Settings
#undef LSPO_KEY
#undef RSPC_KEY
#define LSPO_KEY KC_8 // Nordic Left SpaceCadet
#define RSPC_KEY KC_9 // Nordic Right SpaceCadet
// Audio
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
#define STARTUP_SONG SONG(PLANCK_SOUND) #define STARTUP_SONG SONG(COIN_SOUND)
// #define STARTUP_SONG SONG(NO_SOUND)
#define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \ #define DEFAULT_LAYER_SONGS { SONG(QWERTY_SOUND), \
SONG(COLEMAK_SOUND), \ SONG(COLEMAK_SOUND), \
SONG(DVORAK_SOUND) \ SONG(DVORAK_SOUND) \
} }
#endif
/* /*
* MIDI options * MIDI options
@ -35,5 +42,3 @@
// Most tactile encoders have detents every 4 stages // Most tactile encoders have detents every 4 stages
#define ENCODER_RESOLUTION 4 #define ENCODER_RESOLUTION 4
#endif

@ -1,4 +1,4 @@
/* Copyright 2015-2017 Jack Humbert /* Copyright 2015-2017 Jack Humbert, Christoffer Holmberg
* *
* This program is free software: you can redistribute it and/or modify * This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by * it under the terms of the GNU General Public License as published by
@ -15,158 +15,124 @@
*/ */
#include QMK_KEYBOARD_H #include QMK_KEYBOARD_H
#include "keymap_swedish.h"
#include "muse.h" #include "muse.h"
extern keymap_config_t keymap_config; extern keymap_config_t keymap_config;
enum planck_layers { enum planck_layers {
_QWERTY, _DEFAULT,
_COLEMAK,
_DVORAK,
_LOWER, _LOWER,
_RAISE, _RAISE,
_PLOVER, _UTILITY,
_ADJUST _ADJUST
}; };
enum planck_keycodes { enum planck_keycodes {
QWERTY = SAFE_RANGE, DEFAULT = SAFE_RANGE,
COLEMAK, RAISE,
DVORAK, LOWER,
PLOVER, UTILITY,
BACKLIT, BACKLIT,
EXT_PLV S1, S2, S3, S4, S5, S6, S7, S8, S9
}; };
#define LOWER MO(_LOWER) #define ESC_LOW LT(_LOWER, KC_ESC)
#define RAISE MO(_RAISE) #define BSP_RAI LT(_RAISE, KC_BSPC)
#define LFT_CTR CTL_T(NO_APOS)
#define RGT_CTR CTL_T(KC_TILD)
#define UTILITY MO(_UTILITY)
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Qwerty /* Qwerty
* ,-----------------------------------------------------------------------------------. * ,-----------------------------------------------------------------------------------.
* | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp | * | Tab | Q | W | E | R | T | Y | U | I | O | P | Å |
* |------+------+------+------+------+-------------+------+------+------+------+------| * |------+------+------+------+------+-------------+------+------+------+------+------|
* | Esc | A | S | D | F | G | H | J | K | L | ; | " | * | Fn | A | S | D | F | G | H | J | K | L | Ö | Ä |
* |------+------+------+------+------+------|------+------+------+------+------+------| * |------+------+------+------+------+------|------+------+------+------+------+------|
* | Shift| Z | X | C | V | B | N | M | , | . | / |Enter | * | Shift| Z | X | C | V | B | N | M | , | . | - |Shift |
* |------+------+------+------+------+------+------+------+------+------+------+------| * |------+------+------+------+------+------+------+------+------+------+------+------|
* | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | * | Ctrl | Super| Alt | |L/Esc | Ret | Space|R/Bspc| |AltGr | * | ¨ |
* `-----------------------------------------------------------------------------------' * `-----------------------------------------------------------------------------------'
*/ */
[_QWERTY] = LAYOUT_planck_grid( [_DEFAULT] = LAYOUT_planck_grid(
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_TAB , KC_Q , KC_W , KC_E , KC_R , KC_T , KC_Y , KC_U , KC_I , KC_O , KC_P , NO_AA ,
KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, UTILITY, KC_A , KC_S , KC_D , KC_F , KC_G , KC_H , KC_J , KC_K , KC_L , NO_OSLH, NO_AE ,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT , KC_LSPO, KC_Z , KC_X , KC_C , KC_V , KC_B , KC_N , KC_M , KC_COMM, KC_DOT , NO_MINS, KC_RSPC,
BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT LFT_CTR, KC_LALT, KC_LGUI, NO_AT , ESC_LOW, KC_ENT , KC_SPC , BSP_RAI, _______, NO_ALGR, NO_ASTR, RGT_CTR
), ),
/* Colemak /* Raise
* ,-----------------------------------------------------------------------------------.
* | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Esc | A | R | S | T | D | H | N | E | I | O | " |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | Shift| Z | X | C | V | B | K | M | , | . | / |Enter |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
* `-----------------------------------------------------------------------------------'
*/
[_COLEMAK] = LAYOUT_planck_grid(
KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC,
KC_ESC, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT ,
BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
),
/* Dvorak
* ,-----------------------------------------------------------------------------------. * ,-----------------------------------------------------------------------------------.
* | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp | * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | + |
* |------+------+------+------+------+-------------+------+------+------+------+------| * |------+------+------+------+------+-------------+------+------+------+------+------|
* | Esc | A | O | E | U | I | D | H | T | N | S | / | * | | | | | | | | | | | | |
* |------+------+------+------+------+------|------+------+------+------+------+------| * |------+------+------+------+------+------|------+------+------+------+------+------|
* | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter | * | | | | | | | | | | | | |
* |------+------+------+------+------+------+------+------+------+------+------+------| * |------+------+------+------+------+------+------+------+------+------+------+------|
* | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right | * | | | | | | | | | | | | |
* `-----------------------------------------------------------------------------------' * `-----------------------------------------------------------------------------------'
*/ */
[_DVORAK] = LAYOUT_planck_grid( [_RAISE] = LAYOUT_planck_grid(
KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_PLUS,
KC_ESC, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT , _______, NO_GRTR, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
), ),
/* Lower /* Lower
* ,-----------------------------------------------------------------------------------. * ,-----------------------------------------------------------------------------------.
* | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | * | | | | | | | | | | | | |
* |------+------+------+------+------+-------------+------+------+------+------+------| * |------+------+------+------+------+-------------+------+------+------+------+------|
* | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | | * | | | | | | | | | | | | |
* |------+------+------+------+------+------|------+------+------+------+------+------| * |------+------+------+------+------+------|------+------+------+------+------+------|
* | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | Home | End | | * | | | | | | | | | | | | |
* |------+------+------+------+------+------+------+------+------+------+------+------| * |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | Next | Vol- | Vol+ | Play | * | | | | | | | | | | | | |
* `-----------------------------------------------------------------------------------' * `-----------------------------------------------------------------------------------'
*/ */
[_LOWER] = LAYOUT_planck_grid( [_LOWER] = LAYOUT_planck_grid(
KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, NO_HALF, LSFT(KC_1), NO_QUO2, LSFT(KC_3), NO_BULT, LSFT(KC_5), NO_AMPR, NO_SLSH, NO_LPRN, NO_RPRN, NO_EQL , NO_QUES,
KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), KC_HOME, KC_END, _______, _______, NO_LESS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
),
/* Raise
* ,-----------------------------------------------------------------------------------.
* | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ |
* |------+------+------+------+------+------|------+------+------+------+------+------|
* | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / |Pg Up |Pg Dn | |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | Next | Vol- | Vol+ | Play |
* `-----------------------------------------------------------------------------------'
*/
[_RAISE] = LAYOUT_planck_grid(
KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS,
_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, KC_PGUP, KC_PGDN, _______,
_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
), ),
/* Plover layer (http://opensteno.org) /* Utility layer
* ,-----------------------------------------------------------------------------------. * ,-----------------------------------------------------------------------------------.
* | # | # | # | # | # | # | # | # | # | # | # | # | * | | | up | | | | | | S1 | S2 | S3 | |
* |------+------+------+------+------+-------------+------+------+------+------+------| * |------+------+------+------+------+-------------+------+------+------+------+------|
* | | S | T | P | H | * | * | F | P | L | T | D | * | | left | down | right| | | | | S4 | S5 | S6 | |
* |------+------+------+------+------+------|------+------+------+------+------+------| * |------+------+------+------+------+------|------+------+------+------+------+------|
* | | S | K | W | R | * | * | R | B | G | S | Z | * | | | | | | | | | S7 | S8 | S9 | |
* |------+------+------+------+------+------+------+------+------+------+------+------| * |------+------+------+------+------+------+------+------+------+------+------+------|
* | Exit | | | A | O | | E | U | | | | * | | | | | | | | Del | | | | |
* `-----------------------------------------------------------------------------------' * `-----------------------------------------------------------------------------------'
*/ */
[_PLOVER] = LAYOUT_planck_grid( [_UTILITY] = LAYOUT_planck_grid(
KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 , _______, _______, KC_UP , _______, _______, _______, _______, _______, S1 , S2 , S3 , _______,
XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______, _______, _______, S4 , S5 , S6 , _______,
XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, _______, _______, _______, _______, _______, _______, _______, _______, S7 , S8 , S9 , _______,
EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX _______, _______, _______, _______, _______, _______, _______, KC_DEL , _______, _______, _______, _______
), ),
/* Adjust (Lower + Raise) /* Adjust (Lower + Raise)
* ,-----------------------------------------------------------------------------------. * ,-----------------------------------------------------------------------------------.
* | | Reset| | | | | | | | | | Del | * | F1 | F2 | F3 | F4 | F5 | F6 | F7 | F8 | F9 | F10 | F11 | F12 |
* |------+------+------+------+------+-------------+------+------+------+------+------| * |------+------+------+------+------+-------------+------+------+------+------+------|
* | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| | * | |Reset | |Aud on|Audoff|AGnorm|AGswap|Qwerty| | |Utilit| |
* |------+------+------+------+------+------|------+------+------+------+------+------| * |------+------+------+------+------+------|------+------+------+------+------+------|
* | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | | * | | | | | | | | | | | | |
* |------+------+------+------+------+------+------+------+------+------+------+------| * |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | | | | | * | | | | | | | | | | | | |
* `-----------------------------------------------------------------------------------' * `-----------------------------------------------------------------------------------'
*/ */
[_ADJUST] = LAYOUT_planck_grid( [_ADJUST] = LAYOUT_planck_grid(
_______, RESET, DEBUG, RGB_TOG, RGB_MOD, RGB_HUI, RGB_HUD, RGB_SAI, RGB_SAD, RGB_VAI, RGB_VAD, KC_DEL , KC_F1 , KC_F2 , KC_F3 , KC_F4 , KC_F5 , KC_F6 , KC_F7 , KC_F8 , KC_F9 , KC_F10 , KC_F11 , KC_F12 ,
_______, _______, MU_MOD, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, _______, RESET , MU_MOD , AU_ON , AU_OFF , AG_NORM, AG_SWAP, DEFAULT, XXXXXXX , XXXXXXX, UTILITY, _______,
_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, TERM_ON, TERM_OFF, _______, _______, _______, _______, NO_PIPE, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
) )
@ -176,6 +142,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
float plover_song[][2] = SONG(PLOVER_SOUND); float plover_song[][2] = SONG(PLOVER_SOUND);
float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND); float plover_gb_song[][2] = SONG(PLOVER_GOODBYE_SOUND);
float s1[][2] = SONG(NUMBER_ONE);
float s2[][2] = SONG(ZELDA_PUZZLE);
float s3[][2] = SONG(ZELDA_TREASURE);
float s4[][2] = SONG(OVERWATCH_THEME);
float s5[][2] = SONG(IMPERIAL_MARCH);
float s6[][2] = SONG(E1M1_DOOM);
float s7[][2] = SONG(COIN_SOUND);
float s8[][2] = SONG(ONE_UP_SOUND);
float s9[][2] = SONG(SONIC_RING);
#endif #endif
uint32_t layer_state_set_user(uint32_t state) { uint32_t layer_state_set_user(uint32_t state) {
@ -184,22 +159,9 @@ uint32_t layer_state_set_user(uint32_t state) {
bool process_record_user(uint16_t keycode, keyrecord_t *record) { bool process_record_user(uint16_t keycode, keyrecord_t *record) {
switch (keycode) { switch (keycode) {
case QWERTY: case DEFAULT:
if (record->event.pressed) {
print("mode just switched to qwerty and this is a huge string\n");
set_single_persistent_default_layer(_QWERTY);
}
return false;
break;
case COLEMAK:
if (record->event.pressed) {
set_single_persistent_default_layer(_COLEMAK);
}
return false;
break;
case DVORAK:
if (record->event.pressed) { if (record->event.pressed) {
set_single_persistent_default_layer(_DVORAK); set_single_persistent_default_layer(_DEFAULT);
} }
return false; return false;
break; break;
@ -220,31 +182,75 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
} }
return false; return false;
break; break;
case PLOVER: case S1:
if (record->event.pressed) { if (record->event.pressed) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
stop_all_notes(); PLAY_SONG(s1);
PLAY_SONG(plover_song); #endif //AUDIO_ENABLE
#endif
layer_off(_RAISE);
layer_off(_LOWER);
layer_off(_ADJUST);
layer_on(_PLOVER);
if (!eeconfig_is_enabled()) {
eeconfig_init();
}
keymap_config.raw = eeconfig_read_keymap();
keymap_config.nkro = 1;
eeconfig_update_keymap(keymap_config.raw);
} }
return false; return false;
break; break;
case EXT_PLV: case S2:
if (record->event.pressed) { if (record->event.pressed) {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
PLAY_SONG(plover_gb_song); PLAY_SONG(s2);
#endif #endif //AUDIO_ENABLE
layer_off(_PLOVER); }
return false;
break;
case S3:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_SONG(s3);
#endif //AUDIO_ENABLE
}
return false;
break;
case S4:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_SONG(s4);
#endif //AUDIO_ENABLE
}
return false;
break;
case S5:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_SONG(s5);
#endif //AUDIO_ENABLE
}
return false;
break;
case S6:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_SONG(s6);
#endif //AUDIO_ENABLE
}
return false;
break;
case S7:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_SONG(s7);
#endif //AUDIO_ENABLE
}
return false;
break;
case S8:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_SONG(s8);
#endif //AUDIO_ENABLE
}
return false;
break;
case S9:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_SONG(s9);
#endif //AUDIO_ENABLE
} }
return false; return false;
break; break;

@ -1,3 +1,8 @@
![Nordic Planck](https://i.imgur.com/0ZOLnx2.png)
# Nordic Planck # Nordic Planck
TODO: Add layout image This is my attempt at making a Nordic layout for the planck with all nordic
characters available in the default layer, things to note are the bottom row
with Esc, Enter, Space and Backspace in the middle for easy thumb access and
an arrow cluster on the left.

@ -1 +1,3 @@
SRC += muse.c SRC += muse.c
EXTRAKEY_ENABLE = no
CONSOLE_ENABLE = no

Loading…
Cancel
Save