[Keymap] Update to oeywil's keymap (#5614)

* Switched to grid, added leader key and space cadet shift

* renamed layer, removed sound

* fixed comment

* added comment

* Added tap dance

* Added comments

* removed useless sound

* removed useless comments

* removed useless cases

* changed to register_code16 function

* renamed variables

* fixed typo

* fixed indentation
master
Øyvind Wilhelmsen 2019-04-17 20:07:19 +02:00 committed by Drashna Jaelre
parent 4cd3afc7e9
commit f05927a2f0
6 changed files with 371 additions and 151 deletions

View File

@ -1 +1 @@
secret.h secrets.h

View File

@ -1,7 +1,4 @@
#ifndef CONFIG_USER_H #pragma once
#define CONFIG_USER_H
#include "config_common.h"
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
#define STARTUP_SONG SONG(PLANCK_SOUND) #define STARTUP_SONG SONG(PLANCK_SOUND)
@ -32,7 +29,9 @@
/* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */ /* override number of MIDI tone keycodes (each octave adds 12 keycodes and allocates 12 bytes) */
//#define MIDI_TONE_KEYCODE_OCTAVES 2 //#define MIDI_TONE_KEYCODE_OCTAVES 2
// Most tactile encoders have detents every 4 stages // Leader Key
#define ENCODER_RESOLUTION 4 #define LEADER_TIMEOUT 250
#define LEADER_PER_KEY_TIMING
#endif // Tap dance
#define TAPPING_TERM 200

View File

@ -1,112 +1,139 @@
#include QMK_KEYBOARD_H #include QMK_KEYBOARD_H
#include "secret.h" #include "no_keycodes.h"
#if __has_include("secrets.h")
# include "secrets.h"
#else
# define mail_str ""
# define pwd_str ""
#endif
// layer definitions
enum planck_layers { enum planck_layers {
_DEFAULT, _DEFAULT,
_LOWER, _LOWER,
_RAISE, _RAISE,
_FUNCTION,
_GAME, _GAME,
_GAMERAISE _GLOW
}; };
#define LOWER MO(_LOWER) // sounds
#define RAISE MO(_RAISE) #ifdef AUDIO_ENABLE
#define FUNCTION MO(_FUNCTION) float gamesong[][2] = SONG(MARIO_MUSHROOM);
#define GAMER MO(_GAMERAISE) float defsong[][2] = SONG(PLOVER_GOODBYE_SOUND);
float failed[][2] = SONG(TERMINAL_SOUND);
#endif
#define NO_OE KC_SCLN // leader key
#define NO_AE KC_QUOT bool leader_succeed;
#define NO_AA KC_LBRC bool leader_layer_game;
#define NO_EXCL LSFT(KC_1) bool leader_layer_def;
#define NO_QEST LSFT(KC_MINS) LEADER_EXTERNS();
#define NO_APOS KC_BSLS
#define NO_QUOT LSFT(KC_2)
#define NO_UMLA KC_RBRC
#define NO_HASH LSFT(KC_3)
#define NO_FSLS LSFT(KC_7)
#define NO_LPAR LSFT(KC_8)
#define NO_RPAR LSFT(KC_9)
#define NO_ALFA ALGR(KC_2)
#define NO_AMPE LSFT(KC_6)
#define NO_USDO ALGR(KC_4)
#define NO_PERC LSFT(KC_5)
#define NO_BSLS KC_EQL
#define NO_ASTE LSFT(KC_BSLS)
#define NO_LBRA ALGR(KC_7)
#define NO_RBRA ALGR(KC_0)
#define NO_LBRC ALGR(KC_8)
#define NO_RBRC ALGR(KC_9)
#define NO_ANBR KC_NUBS
#define NO_DASH KC_SLSH
#define NO_PLUS KC_MINS
#define NO_EQUA LSFT(KC_0)
#define TSKMGR LCTL(LSFT(KC_ESC)) void matrix_scan_user(void) {
#define STEAM LSFT(KC_F7) LEADER_DICTIONARY() {
#define WKILL LALT(KC_F4) leader_succeed = leading = false;
#define BWORD LCTL(KC_LEFT) leader_layer_game = false;
#define FWORD LCTL(KC_RIGHT) leader_layer_def = false;
float onsong[][2] = SONG(MARIO_MUSHROOM); SEQ_TWO_KEYS(KC_P, KC_P) {
float offsong[][2] = SONG(PLOVER_GOODBYE_SOUND); SEND_STRING(pwd_str);
leader_succeed = true;
enum custom_keycodes { }
PWD = SAFE_RANGE, SEQ_TWO_KEYS(KC_P, KC_M) {
MAIL, SEND_STRING(mail_str);
GAMEON, leader_succeed = true;
GAMEOFF }
}; SEQ_TWO_KEYS(KC_B, KC_B) {
SEND_STRING("build"SS_TAP(X_ENTER));
bool process_record_user(uint16_t keycode, keyrecord_t *record) { leader_succeed = true;
switch (keycode) { }
case PWD: SEQ_TWO_KEYS(KC_B, KC_F) {
if (record->event.pressed) { SEND_STRING("flash"SS_TAP(X_ENTER));
SEND_STRING(pwd_str); reset_keyboard();
} leader_succeed = true;
break; }
case MAIL: SEQ_TWO_KEYS(KC_L, KC_G) {
if (record->event.pressed) { layer_on(_GAME);
SEND_STRING(mail_str); leader_layer_game = true;
} }
break; SEQ_TWO_KEYS(KC_L, KC_D) {
case GAMEON: layer_off(_GAME);
if (record->event.pressed) { leader_layer_def = true;
#ifdef AUDIO_ENABLE }
PLAY_SONG(onsong); leader_end();
#endif
layer_on(_GAME);
}
break;
case GAMEOFF:
if (record->event.pressed) {
#ifdef AUDIO_ENABLE
PLAY_SONG(offsong);
#endif
layer_off(_GAME);
}
break;
} }
return true; }
void leader_end(void) {
if (leader_succeed) {
// do nothing
} else if (leader_layer_game) {
#ifdef AUDIO_ENABLE
PLAY_SONG(gamesong);
#endif
} else if (leader_layer_def) {
#ifdef AUDIO_ENABLE
PLAY_SONG(defsong);
#endif
} else {
#ifdef AUDIO_ENABLE
PLAY_SONG(failed);
#endif
}
}
// tap dance definitions
typedef struct {
bool is_press_action;
int state;
} tap;
enum {
SINGLE_TAP = 1,
SINGLE_HOLD = 2,
DOUBLE_TAP = 3,
DOUBLE_HOLD = 4,
DOUBLE_SINGLE_TAP = 5,
TRIPLE_TAP = 6,
TRIPLE_HOLD = 7
}; };
enum {
TD_LSFT = 0,
TD_LCTL,
TD_RSFT,
TD_RCTL
};
int cur_dance (qk_tap_dance_state_t *state);
void lsft_finished (qk_tap_dance_state_t *state, void *user_data);
void lsft_reset (qk_tap_dance_state_t *state, void *user_data);
void rsft_finished (qk_tap_dance_state_t *state, void *user_data);
void rsft_reset (qk_tap_dance_state_t *state, void *user_data);
void lctl_finished (qk_tap_dance_state_t *state, void *user_data);
void lctl_reset (qk_tap_dance_state_t *state, void *user_data);
void rctl_finished (qk_tap_dance_state_t *state, void *user_data);
void rctl_reset (qk_tap_dance_state_t *state, void *user_data);
// layer declarations
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* Default /* Default
* ,-----------------------------------------------------------------------------------. * ,-----------------------------------------------------------------------------------.
* | Tab | Q | W | E | R | T | Y | U | I | O | P | BkSp | * | Tab | Q | W | E | R | T | Y | U | I | O | Å | BkSp |
* |------+------+------+------+------+-------------+------+------+------+------+------| * |------+------+------+------+------+-------------+------+------+------+------+------|
* | Esc | A | S | D | F | G | H | J | K | L | Ø | Æ | * | Esc | A | S | D | F | G | H | J | K | L | Ø | Æ |
* |------+------+------+------+------+------+------+------+------+------+------+------| * |------+------+------+------+------+------+------+------+------+------+------+------|
* | Shift| Z | X | C | V | B | N | M | , | . | Å | Shift| * | Shift| Z | X | C | V | B | N | M | P | , | . | Shift|
* |------+------+------+------+------+------+------+------+------+------+------+------| * |------+------+------+------+------+------+------+------+------+------+------+------|
* | Ctrl | Win | Alt | Lower| Space | Enter | Raise| AltGr| Game | Fn | * | Ctrl | Lead | Win | Alt | Lower| Space| Enter| Raise| AltGr| App | Lead | Ctrl |
* `-----------------------------------------------------------------------------------' * `-----------------------------------------------------------------------------------'
*/ */
[_DEFAULT] = 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, NO_AA, KC_BSPC,
KC_GESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, NO_OE, NO_AE, KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, NO_OE, NO_AE,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, NO_AA, KC_RSFT, TD(TD_LSFT), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_P, KC_COMM, KC_DOT, TD(TD_RSFT),
KC_LCTL, KC_LGUI, KC_LALT, LOWER, KC_NO, KC_SPC, KC_NO, KC_ENT, RAISE, KC_RALT, GAMEON, FUNCTION TD(TD_LCTL), KC_LEAD, KC_LGUI, KC_LALT, MO(_LOWER), KC_SPC, KC_ENT, MO(_RAISE), KC_ALGR, KC_APP, KC_LEAD, TD(TD_RCTL)
), ),
/* Lower /* Lower
* ,-----------------------------------------------------------------------------------. * ,-----------------------------------------------------------------------------------.
@ -116,81 +143,250 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |------+------+------+------+------+------|------+------+------+------+------+------| * |------+------+------+------+------+------|------+------+------+------+------+------|
* | Shift| Home | | End | | | | | F1 | F2 | F3 | Shift| * | Shift| Home | | End | | | | | F1 | F2 | F3 | Shift|
* |------+------+------+------+------+------+------+------+------+------+------+------| * |------+------+------+------+------+------+------+------+------+------+------+------|
* | Ctrl | Win | Alt | Lower| Space | Enter | | | | | * | Ctrl | | Win | Alt | Lower| M_PP |M_Next| | | Mute | VolD | VolUp|
* `-----------------------------------------------------------------------------------' * `-----------------------------------------------------------------------------------'
*/ */
[_LOWER] = LAYOUT_planck_grid( [_LOWER] = LAYOUT_planck_grid(
KC_TRNS, BWORD, KC_UP, FWORD, KC_PGUP, KC_NO, KC_NO, KC_NO, KC_F7, KC_F8, KC_F9, KC_DEL, KC_TRNS, LCTL(KC_LEFT), KC_UP, LCTL(KC_RIGHT), KC_PGUP, KC_NO, KC_NO, KC_NO, KC_F7, KC_F8, KC_F9, KC_DEL,
KC_BSPC, KC_LEFT, KC_DOWN, KC_RIGHT, KC_PGDN, KC_NO, KC_NO, KC_NO, KC_F4, KC_F5, KC_F6, KC_NO, KC_BSPC, KC_LEFT, KC_DOWN, KC_RIGHT, KC_PGDN, KC_NO, KC_NO, KC_NO, KC_F4, KC_F5, KC_F6, KC_NO,
KC_TRNS, KC_HOME, KC_NO, KC_END, KC_NO, KC_NO, KC_NO, KC_NO, KC_F1, KC_F2, KC_F3, KC_TRNS, KC_TRNS, KC_HOME, KC_NO, KC_END, KC_NO, KC_NO, KC_NO, KC_NO, KC_F1, KC_F2, KC_F3, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS, KC_NO, KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO KC_TRNS, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_MNXT, KC_NO, KC_NO, KC_MUTE, KC_VOLD, KC_VOLU
), ),
/* Raise /* Raise
* ,-----------------------------------------------------------------------------------. * ,-----------------------------------------------------------------------------------.
* | Tab | ! | ? | ' | " | ¨ | | / | 7 | 8 | 9 | Ins | * | Tab | ! | ? | # | * | | | = | / | 7 | 8 | 9 | Ins |
* |------+------+------+------+------+-------------+------+------+------+------+------| * |------+------+------+------+------+-------------+------+------+------+------+------|
* | BkSp | @ | & | # | $ | % | <> | \ | 4 | 5 | 6 | * | * | BkSp | @ | & | $ | % | ~ | + | \ | 4 | 5 | 6 | |
* |------+------+------+------+------+------+------+------+------+------+------+------| * |------+------+------+------+------+------+------+------+------+------+------+------|
* | Shift| ( | ) | { | } | [ | ] | 0 | 1 | 2 | 3 | Shift| * | Shift| ' | " | ¨ | | | - | 0 | 1 | 2 | 3 | Shift|
* |------+------+------+------+------+------+------+------+------+------+------+------| * |------+------+------+------+------+------+------+------+------+------+------+------|
* | Ctrl | Win | Alt | | Space | Enter | Raise| - | + | = | * | Ctrl | | Win | Alt | | Space| Enter| Raise| AltGr| | | |
* `-----------------------------------------------------------------------------------' * `-----------------------------------------------------------------------------------'
*/ */
[_RAISE] = LAYOUT_planck_grid( [_RAISE] = LAYOUT_planck_grid(
KC_TRNS, NO_EXCL, NO_QEST, NO_APOS, NO_QUOT, NO_UMLA, KC_NO, NO_FSLS, KC_7, KC_8, KC_9, KC_INS, KC_TRNS, NO_EXCL, NO_QEST, NO_HASH, NO_ASTE, NO_PIPE, NO_EQUA, NO_FSLS, KC_7, KC_8, KC_9, KC_INS,
KC_BSPC, NO_ALFA, NO_AMPE, NO_HASH, NO_USDO, NO_PERC, NO_ANBR, NO_BSLS, KC_4, KC_5, KC_6, NO_ASTE, KC_BSPC, NO_ALFA, NO_AMPE, NO_USDO, NO_PERC, NO_TILD, NO_PLUS, NO_BSLS, KC_4, KC_5, KC_6, KC_NO,
KC_TRNS, NO_LPAR, NO_RPAR, NO_LBRA, NO_RBRA, NO_LBRC, NO_RBRC, KC_0, KC_1, KC_2, KC_3, KC_TRNS, KC_TRNS, NO_APOS, NO_QUOT, NO_UMLA, KC_NO, KC_NO, NO_DASH, KC_0, KC_1, KC_2, KC_3, KC_TRNS,
KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_TRNS, KC_NO, KC_TRNS, KC_TRNS, NO_DASH, NO_PLUS, NO_EQUA KC_TRNS, KC_NO, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_NO, KC_NO, KC_NO
),
/* Function
* ,-----------------------------------------------------------------------------------.
* | | | | | |TskMgr| | | | | Pwd | Vol+ |
* |------+------+------+------+------+-------------+------+------+------+------+------|
* | Reset| | | | | | | | Wkill| | | Vol- |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | | | | Mail | | | | VolM |
* |------+------+------+------+------+------+------+------+------+------+------+------|
* | | | | | Play/Pause | Next | | | | |
* `-----------------------------------------------------------------------------------'
*/
[_FUNCTION] = LAYOUT_planck_grid(
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, TSKMGR, KC_NO, KC_NO, KC_NO, KC_NO, PWD, KC_VOLU,
RESET, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, WKILL, KC_NO, KC_NO, KC_VOLD,
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, MAIL, KC_NO, KC_NO, KC_NO, KC_MUTE,
KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_MPLY, KC_NO, KC_MNXT, KC_NO, KC_NO, KC_NO, KC_NO
), ),
/* Game /* Game
* ,-----------------------------------------------------------------------------------. * ,-----------------------------------------------------------------------------------.
* | Tab | Q | W | E | R | T | Y | U | I | O | P | BkSp | * | Tab | Q | W | E | R | T | Y | U | I | O | | BkSp |
* |------+------+------+------+------+-------------+------+------+------+------+------| * |------+------+------+------+------+-------------+------+------+------+------+------|
* | Esc | A | S | D | F | G | H | J | K | L | | | * | Esc | A | S | D | F | G | H | J | K | L | | |
* |------+------+------+------+------+------+------+------+------+------+------+------| * |------+------+------+------+------+------+------+------+------+------+------+------|
* | Shift| Z | X | C | V | B | N | M | | | | | * | Shift| Z | X | C | V | B | N | M | P | , | . | |
* |------+------+------+------+------+------+------+------+------+------+------+------| * |------+------+------+------+------+------+------+------+------+------+------+------|
* | Ctrl | | Alt | Raise| Space | Enter | | | | | * | Ctrl | Lead | | Alt | Lower| Space| Enter| Lower| | | Lead | |
* `-----------------------------------------------------------------------------------' * `-----------------------------------------------------------------------------------'
*/ */
[_GAME] = LAYOUT_planck_grid( [_GAME] = 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_NO, KC_BSPC,
KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_NO, KC_NO, KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_NO, KC_NO,
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_NO, KC_NO, KC_NO, KC_NO, KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_P, KC_COMM, KC_DOT, KC_NO,
KC_LCTL, KC_NO, KC_LALT, GAMER, KC_NO, KC_SPC, KC_NO, KC_ENT, KC_NO, KC_NO, KC_NO, KC_NO KC_LCTL, KC_LEAD, KC_NO, KC_LALT, MO(_GLOW), KC_SPC, KC_ENT, MO(_GLOW), KC_NO, KC_NO, KC_LEAD, KC_NO
), ),
/* Game raise /* Game lower
* ,-----------------------------------------------------------------------------------. * ,-----------------------------------------------------------------------------------.
* | Tab | 1 | 2 | 3 | 4 | 5 | | | | | | Vol+ | * | Tab | 1 | 2 | 3 | | | | | | | | Steam|
* |------+------+------+------+------+-------------+------+------+------+------+------| * |------+------+------+------+------+-------------+------+------+------+------+------|
* | Esc | F1 | F2 | F3 | F4 | F5 | | | | | | Vol- | * | Esc | 4 | 5 | 6 | | | | | | | | F12 |
* |------+------+------+------+------+------+------+------+------+------+------+------| * |------+------+------+------+------+------+------+------+------+------+------+------|
* | Shift| | | | | | | | | | | VolM | * | Shift| 7 | 8 | 9 | 0 | | | | | | | |
* |------+------+------+------+------+------+------+------+------+------+------+------| * |------+------+------+------+------+------+------+------+------+------+------+------|
* | Ctrl | | Alt | | Space | Enter | | | Def | Steam| * | Ctrl | | | Alt | | PlyPa| Next | | | Mute | VolD | VolUp|
* `-----------------------------------------------------------------------------------' * `-----------------------------------------------------------------------------------'
*/ */
[_GAMERAISE] = LAYOUT_planck_grid( [_GLOW] = LAYOUT_planck_grid(
KC_TRNS, KC_1, KC_2, KC_3, KC_4, KC_5, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_VOLU, KC_TRNS, KC_1, KC_2, KC_3, KC_PPLS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, LSFT(KC_F7),
KC_TRNS, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_VOLD, KC_TRNS, KC_4, KC_5, KC_6, KC_PMNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_F12,
KC_TRNS, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_MUTE, KC_TRNS, KC_7, KC_8, KC_9, KC_0, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_MUTE,
KC_TRNS, KC_NO, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS, KC_NO, KC_TRNS, KC_NO, KC_NO, GAMEOFF, STEAM KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_MPLY, KC_MNXT, KC_NO, KC_TRNS, KC_MUTE, KC_VOLD, KC_VOLU
) )
}; };
// tap dance declarations
int cur_dance (qk_tap_dance_state_t *state) {
if (state->count == 1) {
if (state->interrupted || !state->pressed) return SINGLE_TAP;
else return SINGLE_HOLD;
}
else if (state->count == 2) {
if (state->interrupted) return DOUBLE_SINGLE_TAP;
else if (state->pressed) return DOUBLE_HOLD;
else return DOUBLE_TAP;
}
if (state->count == 3) {
if (state->interrupted || !state->pressed) return TRIPLE_TAP;
else return TRIPLE_HOLD;
}
else return 8;
}
static tap xtap_state = {
.is_press_action = true,
.state = 0
};
void lsft_finished (qk_tap_dance_state_t *state, void *user_data) {
xtap_state.state = cur_dance(state);
switch (xtap_state.state) {
case SINGLE_TAP:
register_code16(LSFT(KC_8));
break;
case SINGLE_HOLD:
register_code(KC_LSFT);
break;
case DOUBLE_TAP:
register_code(KC_NUBS);
break;
case DOUBLE_SINGLE_TAP:
register_code(KC_NUBS);
break;
}
}
void lsft_reset (qk_tap_dance_state_t *state, void *user_data) {
switch (xtap_state.state) {
case SINGLE_TAP:
unregister_code16(LSFT(KC_8));
break;
case SINGLE_HOLD:
unregister_code(KC_LSFT);
break;
case DOUBLE_TAP:
unregister_code(KC_NUBS);
break;
case DOUBLE_SINGLE_TAP:
unregister_code(KC_NUBS);
break;
}
xtap_state.state = 0;
}
void rsft_finished (qk_tap_dance_state_t *state, void *user_data) {
xtap_state.state = cur_dance(state);
switch (xtap_state.state) {
case SINGLE_TAP:
register_code16(LSFT(KC_9));
break;
case SINGLE_HOLD:
register_code(KC_RSFT);
break;
case DOUBLE_TAP:
register_code16(LSFT(KC_NUBS));
break;
case DOUBLE_SINGLE_TAP:
register_code16(LSFT(KC_NUBS));
break;
}
}
void rsft_reset (qk_tap_dance_state_t *state, void *user_data) {
switch (xtap_state.state) {
case SINGLE_TAP:
unregister_code16(LSFT(KC_9));
break;
case SINGLE_HOLD:
unregister_code(KC_RSFT);
break;
case DOUBLE_TAP:
unregister_code16(LSFT(KC_NUBS));
break;
case DOUBLE_SINGLE_TAP:
unregister_code16(LSFT(KC_NUBS));
break;
}
xtap_state.state = 0;
}
void lctl_finished (qk_tap_dance_state_t *state, void *user_data) {
xtap_state.state = cur_dance(state);
switch (xtap_state.state) {
case SINGLE_TAP:
register_mods(MOD_BIT(KC_ALGR));
register_code(KC_7);
break;
case SINGLE_HOLD:
register_code(KC_LCTL);
break;
case DOUBLE_TAP:
register_mods(MOD_BIT(KC_ALGR));
register_code(KC_8);
break;
case DOUBLE_SINGLE_TAP:
register_mods(MOD_BIT(KC_ALGR));
register_code(KC_8);
break;
}
}
void lctl_reset (qk_tap_dance_state_t *state, void *user_data) {
switch (xtap_state.state) {
case SINGLE_TAP:
unregister_code(KC_7);
unregister_mods(MOD_BIT(KC_ALGR));
break;
case SINGLE_HOLD:
unregister_code(KC_LCTL);
break;
case DOUBLE_TAP:
unregister_code(KC_8);
unregister_mods(MOD_BIT(KC_ALGR));
break;
case DOUBLE_SINGLE_TAP:
unregister_code(KC_8);
unregister_mods(MOD_BIT(KC_ALGR));
break;
}
xtap_state.state = 0;
}
void rctl_finished (qk_tap_dance_state_t *state, void *user_data) {
xtap_state.state = cur_dance(state);
switch (xtap_state.state) {
case SINGLE_TAP:
register_mods(MOD_BIT(KC_ALGR));
register_code(KC_0);
break;
case SINGLE_HOLD:
register_code(KC_RCTL);
break;
case DOUBLE_TAP:
register_mods(MOD_BIT(KC_ALGR));
register_code(KC_9);
break;
case DOUBLE_SINGLE_TAP:
register_mods(MOD_BIT(KC_ALGR));
register_code(KC_9);
break;
}
}
void rctl_reset (qk_tap_dance_state_t *state, void *user_data) {
switch (xtap_state.state) {
case SINGLE_TAP:
unregister_code(KC_0);
unregister_mods(MOD_BIT(KC_ALGR));
break;
case SINGLE_HOLD:
unregister_code(KC_RCTL);
break;
case DOUBLE_TAP:
unregister_code(KC_9);
unregister_mods(MOD_BIT(KC_ALGR));
break;
case DOUBLE_SINGLE_TAP:
unregister_code(KC_9);
unregister_mods(MOD_BIT(KC_ALGR));
break;
}
xtap_state.state = 0;
}
qk_tap_dance_action_t tap_dance_actions[] = {
[TD_LSFT] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, lsft_finished, lsft_reset),
[TD_RSFT] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, rsft_finished, rsft_reset),
[TD_LCTL] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, lctl_finished, lctl_reset),
[TD_RCTL] = ACTION_TAP_DANCE_FN_ADVANCED(NULL, rctl_finished, rctl_reset),
};

View File

@ -0,0 +1,28 @@
// øæå
#define NO_OE KC_SCLN
#define NO_AE KC_QUOT
#define NO_AA KC_LBRC
// rename
#define NO_ANBR KC_NUBS
#define NO_APOS KC_BSLS
#define NO_BSLS KC_EQL
#define NO_DASH KC_SLSH
#define NO_PLUS KC_MINS
#define NO_UMLA KC_RBRC
#define NO_PIPE KC_GRV
// shifted
#define NO_EXCL LSFT(KC_1)
#define NO_QUOT LSFT(KC_2)
#define NO_HASH LSFT(KC_3)
#define NO_PERC LSFT(KC_5)
#define NO_AMPE LSFT(KC_6)
#define NO_FSLS LSFT(KC_7)
#define NO_LPAR LSFT(KC_8)
#define NO_RPAR LSFT(KC_9)
#define NO_EQUA LSFT(KC_0)
#define NO_QEST LSFT(KC_MINS)
#define NO_ASTE LSFT(KC_BSLS)
// altgr
#define NO_ALFA ALGR(KC_2)
#define NO_USDO ALGR(KC_4)
#define NO_TILD ALGR(KC_RBRC)

View File

@ -1,9 +1,4 @@
About About
------ ------
A simple Norwegian Layout. A simple Norwegian grid layout using Leader Key, Space Cadet Shift and audio.
Layout
-------
![Layout](https://i.imgur.com/GQ4iM6B.png "Keyboard Layout")

View File

@ -1,9 +1,11 @@
SRC += muse.c SRC += muse.c
# Build Options # Build Options
AUDIO_ENABLE = yes NKRO_ENABLE = yes
CONSOLE_ENABLE = no EXTRAKEY_ENABLE = yes
EXTRAKEY_ENABLE = yes LEADER_ENABLE = yes
NKRO_ENABLE = yes TAP_DANCE_ENABLE = yes
AUDIO_ENABLE = yes
DEFAULT_FOLDER = planck/rev6 COMMAND_ENABLE = no
CONSOLE_ENABLE = no
MOUSEKEY_ENABLE = no