diff options
Diffstat (limited to 'keyboards/planck/keymaps/circuit/keymap.c')
-rw-r--r-- | keyboards/planck/keymaps/circuit/keymap.c | 165 |
1 files changed, 83 insertions, 82 deletions
diff --git a/keyboards/planck/keymaps/circuit/keymap.c b/keyboards/planck/keymaps/circuit/keymap.c index 3e94fe1f4e..35f41c3872 100644 --- a/keyboards/planck/keymaps/circuit/keymap.c +++ b/keyboards/planck/keymaps/circuit/keymap.c @@ -1,5 +1,6 @@ // Layout picture at http://www.keyboard-layout-editor.com/#/gists/125febfad6960add078e6f14256539b6 +#pragma message "You may need to add LAYOUT_planck_grid to your keymap layers - see default for an example" #include "planck.h" #include "action_layer.h" #ifdef AUDIO_ENABLE @@ -21,21 +22,21 @@ extern keymap_config_t keymap_config; #define _FUNCTN 5 enum planck_keycodes { - QWERTY = SAFE_RANGE, - DVORAK, - NUMBER, - ACTION + QWERTY = SAFE_RANGE, + DVORAK, + NUMBER, + ACTION }; // Key code names -#define SFT_ENT FUNC(0) // Tap for enter, hold for right shift +#define SFT_ENT FUNC(0) // Tap for enter, hold for right shift #define LOCK FUNC(1) #define KC_PSTE KC_PASTE #define _______ KC_TRNS #define XXXXXXX KC_NO #ifdef TAP_DANCE_ENABLE -#define SFT_CAP TD(0) // Left shift, double tap for caps +#define SFT_CAP TD(0) // Left shift, double tap for caps #endif #ifndef TAP_DANCE_ENABLE #define SFT_CAP KC_LSFT // Regular left shift @@ -44,14 +45,14 @@ enum planck_keycodes { // Tap Dance Definitions #ifdef TAP_DANCE_ENABLE qk_tap_dance_action_t tap_dance_actions[] = { - [0] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS) + [0] = ACTION_TAP_DANCE_DOUBLE(KC_LSFT, KC_CAPS) }; #endif // Function definitions const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_ENT), - [1] = ACTION_LAYER_TOGGLE(_LOCKED) + [0] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_ENT), + [1] = ACTION_LAYER_TOGGLE(_LOCKED) }; // Layout definitions @@ -69,10 +70,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_QWERTY] = { - {KC_ESC, 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_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, - {SFT_CAP, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, SFT_ENT}, - {KC_LCTL, KC_LALT, KC_LGUI, KC_VOLD, ACTION, KC_SPC, KC_SPC, NUMBER, KC_VOLU, KC_LEFT, KC_DOWN, KC_RGHT} + {KC_ESC, 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_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT}, + {SFT_CAP, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_UP, SFT_ENT}, + {KC_LCTL, KC_LALT, KC_LGUI, KC_VOLD, ACTION, KC_SPC, KC_SPC, NUMBER, KC_VOLU, KC_LEFT, KC_DOWN, KC_RGHT} }, /* DVORAK @@ -87,10 +88,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_DVORAK] = { - {_______, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, _______}, - {_______, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_Z }, - {_______, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} + {_______, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, _______}, + {_______, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_Z }, + {_______, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______} }, /* LOCK @@ -105,10 +106,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_LOCKED] = { - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - {KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, - {_______, _______, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, _______} + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {KC_LSFT, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, + {_______, _______, XXXXXXX, _______, _______, _______, _______, _______, _______, _______, _______, _______} }, /* NUMBERS @@ -123,10 +124,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_NUMBER] = { - {_______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______}, - {_______, KC_TILD, XXXXXXX, XXXXXXX, XXXXXXX, KC_PIPE, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_QUES, KC_SLSH}, - {_______, KC_GRV, XXXXXXX, XXXXXXX, XXXXXXX, KC_BSLS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______, _______}, - {_______, _______, _______, _______, _______, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______} + {_______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______}, + {_______, KC_TILD, XXXXXXX, XXXXXXX, XXXXXXX, KC_PIPE, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_QUES, KC_SLSH}, + {_______, KC_GRV, XXXXXXX, XXXXXXX, XXXXXXX, KC_BSLS, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, _______, _______}, + {_______, _______, _______, _______, _______, XXXXXXX, XXXXXXX, _______, _______, _______, _______, _______} }, /* ACTIONS @@ -141,10 +142,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_ACTION] = { - {_______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL }, - {_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX}, - {KC_CAPS, KC_UNDO, KC_CUT, KC_COPY, KC_PSTE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PGUP, KC_ENT }, - {_______, _______, _______, KC_MUTE, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, KC_HOME, KC_PGDN, KC_END } + {_______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_DEL }, + {_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX}, + {KC_CAPS, KC_UNDO, KC_CUT, KC_COPY, KC_PSTE, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, KC_PGUP, KC_ENT }, + {_______, _______, _______, KC_MUTE, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, KC_HOME, KC_PGDN, KC_END } }, /* FUNCTIONS @@ -159,10 +160,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-----------------------------------------------------------------------------------' */ [_FUNCTN] = { - {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12 }, - {KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24 }, - {XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, QWERTY, DVORAK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX}, - {RESET, XXXXXXX, LOCK, XXXXXXX, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX} + {KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12 }, + {KC_F13, KC_F14, KC_F15, KC_F16, KC_F17, KC_F18, KC_F19, KC_F20, KC_F21, KC_F22, KC_F23, KC_F24 }, + {XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, QWERTY, DVORAK, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX}, + {RESET, XXXXXXX, LOCK, XXXXXXX, _______, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX} } }; @@ -177,56 +178,56 @@ float tone_goodbye[][2] = SONG(GOODBYE_SOUND); bool process_record_user(uint16_t keycode, keyrecord_t *record) { - switch (keycode) { - case QWERTY: - if (record->event.pressed) { - if (IS_LAYER_ON(_DVORAK)) { + switch (keycode) { + case QWERTY: + if (record->event.pressed) { + if (IS_LAYER_ON(_DVORAK)) { #ifdef AUDIO_ENABLE - PLAY_SONG(tone_qwerty); + PLAY_SONG(tone_qwerty); #endif - layer_off(_DVORAK); - } - } - return false; - break; - case DVORAK: - if (record->event.pressed) { - if (!IS_LAYER_ON(_DVORAK)) { + layer_off(_DVORAK); + } + } + return false; + break; + case DVORAK: + if (record->event.pressed) { + if (!IS_LAYER_ON(_DVORAK)) { #ifdef AUDIO_ENABLE - PLAY_SONG(tone_dvorak); + PLAY_SONG(tone_dvorak); #endif - layer_on(_DVORAK); - } - } - return false; - break; - case NUMBER: - if (record->event.pressed) { - layer_on(_NUMBER); - update_tri_layer(_NUMBER, _ACTION, _FUNCTN); - } else { - layer_off(_NUMBER); - update_tri_layer(_NUMBER, _ACTION, _FUNCTN); - } - return false; - break; - case ACTION: - if (record->event.pressed) { - layer_on(_ACTION); - update_tri_layer(_NUMBER, _ACTION, _FUNCTN); - } else { - layer_off(_ACTION); - update_tri_layer(_NUMBER, _ACTION, _FUNCTN); - } - return false; - break; - } - return true; + layer_on(_DVORAK); + } + } + return false; + break; + case NUMBER: + if (record->event.pressed) { + layer_on(_NUMBER); + update_tri_layer(_NUMBER, _ACTION, _FUNCTN); + } else { + layer_off(_NUMBER); + update_tri_layer(_NUMBER, _ACTION, _FUNCTN); + } + return false; + break; + case ACTION: + if (record->event.pressed) { + layer_on(_ACTION); + update_tri_layer(_NUMBER, _ACTION, _FUNCTN); + } else { + layer_off(_ACTION); + update_tri_layer(_NUMBER, _ACTION, _FUNCTN); + } + return false; + break; + } + return true; } void matrix_init_user(void) { #ifdef AUDIO_ENABLE - startup_user(); + startup_user(); #endif } @@ -234,25 +235,25 @@ void matrix_init_user(void) { void startup_user() { - _delay_ms(20); // gets rid of tick - PLAY_SONG(tone_startup); + _delay_ms(20); // gets rid of tick + PLAY_SONG(tone_startup); } void shutdown_user() { - PLAY_SONG(tone_goodbye); - _delay_ms(150); - stop_all_notes(); + PLAY_SONG(tone_goodbye); + _delay_ms(150); + stop_all_notes(); } void music_on_user(void) { - music_scale_user(); + music_scale_user(); } void music_scale_user(void) { - PLAY_SONG(music_scale); + PLAY_SONG(music_scale); } #endif |