2016-07-24 04:06:19 +02:00
|
|
|
// This is the canonical layout file for the Quantum project. If you want to add another keyboard,
|
|
|
|
// this is the style you want to emulate.
|
|
|
|
|
|
|
|
#include "planck.h"
|
|
|
|
#include "action_layer.h"
|
|
|
|
#ifdef AUDIO_ENABLE
|
|
|
|
#include "audio.h"
|
|
|
|
#endif
|
|
|
|
#include "eeconfig.h"
|
|
|
|
|
|
|
|
extern keymap_config_t keymap_config;
|
|
|
|
|
|
|
|
// Each layer gets a name for readability, which is then used in the keymap matrix below.
|
|
|
|
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
|
|
|
|
// Layer names don't all need to be of the same length, obviously, and you can also skip them
|
|
|
|
// entirely and just use numbers.
|
|
|
|
#define _QWERTY 0
|
|
|
|
#define _COLEMAK 1
|
|
|
|
#define _DVORAK 2
|
|
|
|
#define _LOWER 3
|
|
|
|
#define _RAISE 4
|
|
|
|
#define _PLOVER 5
|
2016-07-26 05:25:03 +02:00
|
|
|
#define _TOUCHCURSOR 6
|
2016-08-06 08:31:35 +02:00
|
|
|
#define _MOUSECURSOR 7
|
2016-07-24 04:06:19 +02:00
|
|
|
#define _ADJUST 16
|
|
|
|
|
2016-08-01 02:16:25 +02:00
|
|
|
// Keycodes
|
2016-07-24 04:06:19 +02:00
|
|
|
enum planck_keycodes {
|
|
|
|
QWERTY = SAFE_RANGE,
|
|
|
|
COLEMAK,
|
|
|
|
DVORAK,
|
|
|
|
PLOVER,
|
|
|
|
LOWER,
|
|
|
|
RAISE,
|
|
|
|
BACKLIT,
|
|
|
|
EXT_PLV
|
|
|
|
};
|
|
|
|
|
2016-08-01 02:16:25 +02:00
|
|
|
enum macro_keycodes {
|
|
|
|
KC_ALT_TAB,
|
|
|
|
KC_CMD_TAB,
|
|
|
|
KC_CTL_TAB,
|
2016-08-02 07:02:39 +02:00
|
|
|
KC_CMD_SLSH,
|
2016-08-04 05:00:54 +02:00
|
|
|
KC_AG_FIND,
|
|
|
|
KC_AG_AGAIN,
|
|
|
|
KC_AG_UNDO,
|
|
|
|
KC_AG_CUT,
|
|
|
|
KC_AG_COPY,
|
|
|
|
KC_AG_PASTE,
|
2016-08-01 02:16:25 +02:00
|
|
|
};
|
|
|
|
|
2016-07-24 04:06:19 +02:00
|
|
|
// Fillers to make layering more clear
|
|
|
|
#define _______ KC_TRNS
|
|
|
|
#define XXXXXXX KC_NO
|
|
|
|
|
2016-07-24 04:59:22 +02:00
|
|
|
// Custom macros
|
|
|
|
#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl
|
2016-07-26 22:34:01 +02:00
|
|
|
#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift
|
2016-08-01 02:16:25 +02:00
|
|
|
// Requires KC_TRNS/_______ for the trigger key in the destination layer
|
2016-08-06 08:31:35 +02:00
|
|
|
#define LT_TC LT(_TOUCHCURSOR, KC_SPC) // L-ayer T-ap T-ouch C-ursor
|
|
|
|
#define LT_MC(kc) LT(_MOUSECURSOR, kc) // L-ayer T-ap M-ouse C-ursor
|
2016-08-01 02:16:25 +02:00
|
|
|
#define ALT_TAB M(KC_ALT_TAB) // Macro for Alt-Tab
|
|
|
|
#define CMD_TAB M(KC_CMD_TAB) // Macro for Cmd-Tab
|
|
|
|
#define CTL_TAB M(KC_CTL_TAB) // Macro for Ctl-Tab
|
2016-08-02 07:02:39 +02:00
|
|
|
#define CMD_SLSH M(KC_CMD_SLSH) // Macro for Cmd-Slash (personal shortcut to toggle iTerm2 visibility)
|
2016-08-04 05:00:54 +02:00
|
|
|
#define AG_FIND M(KC_AG_FIND) // Macros for Cmd-[x] vs Ctrl-[x] based on current AG_NORM or AG_SWAP settings
|
|
|
|
#define AG_AGAIN M(KC_AG_AGAIN)
|
|
|
|
#define AG_UNDO M(KC_AG_UNDO)
|
|
|
|
#define AG_CUT M(KC_AG_CUT)
|
|
|
|
#define AG_COPY M(KC_AG_COPY)
|
|
|
|
#define AG_PASTE M(KC_AG_PASTE)
|
2016-07-24 04:59:22 +02:00
|
|
|
|
2016-07-24 04:06:19 +02:00
|
|
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|
|
|
|
|
|
|
/* Qwerty
|
2016-07-26 22:34:01 +02:00
|
|
|
* ,-----------------------------------------------------------------------------------------.
|
|
|
|
* | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
|
|
|
|
* |----------+------+------+------+------+-------------+------+------+------+------+--------|
|
2016-08-06 08:31:35 +02:00
|
|
|
* | Ctrl/Esc | A | S | MC/D | F | G | H | J | K | L | ; | " |
|
2016-07-26 22:34:01 +02:00
|
|
|
* |----------+------+------+------+------+------|------+------+------+------+------+--------|
|
|
|
|
* | Shift | Z | X | C | V | B | N | M | , | . | / |Sft/Ent |
|
|
|
|
* |----------+------+------+------+------+------+------+------+------+------+------+--------|
|
2016-07-29 00:13:22 +02:00
|
|
|
* | PrntScrn | RGUI | Alt | GUI |Lower | TC/Space |Raise | Next | Vol- | Vol+ | Play |
|
2016-07-26 22:34:01 +02:00
|
|
|
* `-----------------------------------------------------------------------------------------'
|
2016-07-24 04:06:19 +02:00
|
|
|
*/
|
|
|
|
[_QWERTY] = {
|
|
|
|
{KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC},
|
2016-08-06 08:31:35 +02:00
|
|
|
{CTL_ESC, KC_A, KC_S, LT_MC(KC_D),KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT},
|
2016-07-26 22:34:01 +02:00
|
|
|
{KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT},
|
2016-07-29 00:13:22 +02:00
|
|
|
{KC_PSCR, KC_RGUI, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
|
2016-07-24 04:06:19 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
/* Colemak
|
2016-07-26 22:34:01 +02:00
|
|
|
* ,-----------------------------------------------------------------------------------------.
|
|
|
|
* | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp |
|
|
|
|
* |----------+------+------+------+------+-------------+------+------+------+------+--------|
|
2016-08-06 08:31:35 +02:00
|
|
|
* | Ctrl/Esc | A | R | MC/S | T | D | H | N | E | I | O | " |
|
2016-07-26 22:34:01 +02:00
|
|
|
* |----------+------+------+------+------+------|------+------+------+------+------+--------|
|
|
|
|
* | Shift | Z | X | C | V | B | K | M | , | . | / |Sft/Ent |
|
|
|
|
* |----------+------+------+------+------+------+------+------+------+------+------+--------|
|
2016-07-29 00:13:22 +02:00
|
|
|
* | PrntScrn | RGUI | Alt | GUI |Lower | TC/Space |Raise | Next | Vol- | Vol+ | Play |
|
2016-07-26 22:34:01 +02:00
|
|
|
* `-----------------------------------------------------------------------------------------'
|
2016-07-24 04:06:19 +02:00
|
|
|
*/
|
|
|
|
[_COLEMAK] = {
|
|
|
|
{KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC},
|
2016-08-06 08:31:35 +02:00
|
|
|
{CTL_ESC, KC_A, KC_R, LT_MC(KC_S),KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOT},
|
2016-07-26 22:34:01 +02:00
|
|
|
{KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT},
|
2016-07-29 00:13:22 +02:00
|
|
|
{KC_PSCR, KC_RGUI, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
|
2016-07-24 04:06:19 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
/* Dvorak
|
2016-07-26 22:34:01 +02:00
|
|
|
* ,-----------------------------------------------------------------------------------------.
|
|
|
|
* | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp |
|
|
|
|
* |----------+------+------+------+------+-------------+------+------+------+------+--------|
|
2016-08-06 08:31:35 +02:00
|
|
|
* | Ctrl/Esc | A | O | MC/E | U | I | D | H | T | N | S | / |
|
2016-07-26 22:34:01 +02:00
|
|
|
* |----------+------+------+------+------+------|------+------+------+------+------+--------|
|
|
|
|
* | Shift | ; | Q | J | K | X | B | M | W | V | Z |Sft/Ent |
|
|
|
|
* |----------+------+------+------+------+------+------+------+------+------+------+--------|
|
2016-07-29 00:13:22 +02:00
|
|
|
* | PrntScrn | RGUI | Alt | GUI |Lower | TC/Space |Raise | Next | Vol- | Vol+ | Play |
|
2016-07-26 22:34:01 +02:00
|
|
|
* `-----------------------------------------------------------------------------------------'
|
2016-07-24 04:06:19 +02:00
|
|
|
*/
|
|
|
|
[_DVORAK] = {
|
|
|
|
{KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC},
|
2016-08-06 08:31:35 +02:00
|
|
|
{CTL_ESC, KC_A, KC_O, LT_MC(KC_E),KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SLSH},
|
2016-07-26 22:34:01 +02:00
|
|
|
{KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT},
|
2016-07-29 00:13:22 +02:00
|
|
|
{KC_PSCR, KC_RGUI, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
|
2016-07-24 04:06:19 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
/* Lower
|
|
|
|
* ,-----------------------------------------------------------------------------------.
|
|
|
|
* | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp |
|
|
|
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
2016-07-30 21:26:51 +02:00
|
|
|
* | [ | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | |
|
2016-07-24 04:06:19 +02:00
|
|
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
2016-07-30 21:26:51 +02:00
|
|
|
* | ] | F7 | F8 | F9 | F10 | F11 | F12 | - | = | [ | ] | \ |
|
2016-07-24 04:06:19 +02:00
|
|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
2016-07-29 00:13:22 +02:00
|
|
|
* |Brite | | | | | | | Prev | Stop | Slct | Mute |
|
2016-07-24 04:06:19 +02:00
|
|
|
* `-----------------------------------------------------------------------------------'
|
|
|
|
*/
|
|
|
|
[_LOWER] = {
|
|
|
|
{KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC},
|
2016-07-30 21:26:51 +02:00
|
|
|
{KC_LBRC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE},
|
|
|
|
{KC_RBRC, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS},
|
2016-07-29 00:13:22 +02:00
|
|
|
{BACKLIT, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MSTP, KC_MSEL, KC_MUTE}
|
2016-07-24 04:06:19 +02:00
|
|
|
},
|
|
|
|
|
|
|
|
/* Raise
|
|
|
|
* ,-----------------------------------------------------------------------------------.
|
2016-07-30 21:21:04 +02:00
|
|
|
* | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
|
2016-07-24 04:06:19 +02:00
|
|
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
2016-08-02 00:28:05 +02:00
|
|
|
* | $ | 4 | 5 | 6 | . | + | . | 4 | 5 | 6 | * | | |
|
2016-07-24 04:06:19 +02:00
|
|
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
2016-08-02 00:28:05 +02:00
|
|
|
* | = | 7 | 8 | 9 | 0 | - | . | 1 | 2 | 3 | / | \ |
|
2016-07-24 04:06:19 +02:00
|
|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
2016-07-29 00:13:22 +02:00
|
|
|
* |Brite | | | | | | | Prev | Stop | Slct | Mute |
|
2016-07-24 04:06:19 +02:00
|
|
|
* `-----------------------------------------------------------------------------------'
|
|
|
|
*/
|
|
|
|
[_RAISE] = {
|
2016-07-30 21:21:04 +02:00
|
|
|
{KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC},
|
2016-08-02 00:28:05 +02:00
|
|
|
{KC_DLR, KC_4, KC_5, KC_6, KC_DOT, KC_PLUS, KC_DOT, KC_4, KC_5, KC_6, KC_ASTR, KC_PIPE},
|
|
|
|
{KC_EQL, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_DOT, KC_1, KC_2, KC_3, KC_SLSH, KC_BSLS},
|
2016-07-29 00:13:22 +02:00
|
|
|
{BACKLIT, _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MSTP, KC_MSEL, KC_MUTE}
|
2016-07-24 04:06:19 +02:00
|
|
|
},
|
|
|
|
|
2016-07-26 05:25:03 +02:00
|
|
|
/* TouchCursor layer (http://martin-stone.github.io/touchcursor/) plus personal customizations
|
|
|
|
* ,-----------------------------------------------------------------------------------.
|
2016-08-01 02:16:25 +02:00
|
|
|
* |AltTab|CmdTab|CtlTab| GUI |Shift | ~ |Insert| Home | Up | End | Bksp | |
|
2016-07-26 05:25:03 +02:00
|
|
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
2016-07-30 21:50:13 +02:00
|
|
|
* | | Alt |Space | | Find |Again | PgUp | Left | Down |Right | | |
|
2016-07-26 05:25:03 +02:00
|
|
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
2016-07-30 21:50:13 +02:00
|
|
|
* | | Undo | Cut | Copy |Paste | ` | PgDn | Del | | | | |
|
2016-07-26 05:25:03 +02:00
|
|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
2016-07-28 07:48:27 +02:00
|
|
|
* | | | | | | | | | | | |
|
2016-07-26 05:25:03 +02:00
|
|
|
* `-----------------------------------------------------------------------------------'
|
2016-07-30 21:50:13 +02:00
|
|
|
*
|
|
|
|
* The KC_UNDO, KC_CUT, KC_COPY, KC_PASTE, KC_FIND, and KC_AGAIN keycodes don't
|
|
|
|
* seem to work on Mac. Presumably they'll work under Windows.
|
2016-07-26 05:25:03 +02:00
|
|
|
*/
|
|
|
|
|
|
|
|
[_TOUCHCURSOR] = {
|
2016-08-01 02:16:25 +02:00
|
|
|
{ALT_TAB, CMD_TAB, CTL_TAB, KC_LGUI, KC_LSFT, KC_TILD, KC_INS, KC_HOME, KC_UP, KC_END, KC_BSPC, _______},
|
2016-08-04 05:00:54 +02:00
|
|
|
{_______, KC_LALT, KC_SPC, _______, AG_FIND,AG_AGAIN, KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______},
|
|
|
|
{_______, AG_UNDO, AG_CUT, AG_COPY, AG_PASTE,KC_GRV, KC_PGDN, KC_DEL, _______, _______, CMD_SLSH,_______},
|
2016-07-28 07:48:27 +02:00
|
|
|
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
|
|
|
|
},
|
|
|
|
|
|
|
|
/* Mouse Layer
|
|
|
|
* ,-----------------------------------------------------------------------------------.
|
2016-08-06 09:08:42 +02:00
|
|
|
* | | |ACCL0 | | | | |WHL_L | Up |WHL_R | BTN2 | |
|
2016-07-28 07:48:27 +02:00
|
|
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
2016-08-06 09:08:42 +02:00
|
|
|
* | |ACCL2 | BTN2 | | BTN1 |ACCL1 |WHL_Up| Left | Down |Right | BTN4 | BTN5 |
|
2016-07-28 07:48:27 +02:00
|
|
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
2016-08-06 08:31:35 +02:00
|
|
|
* | | | | | BTN3 | |WHL_Dn| BTN1 | | | BTN3 | |
|
2016-07-28 07:48:27 +02:00
|
|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
|
|
|
* | | | | | | | | | | | |
|
|
|
|
* `-----------------------------------------------------------------------------------'
|
|
|
|
*/
|
|
|
|
|
2016-08-06 08:31:35 +02:00
|
|
|
[_MOUSECURSOR] = {
|
2016-08-06 09:08:42 +02:00
|
|
|
{_______, _______, KC_ACL0, _______, _______, _______, _______, KC_WH_L, KC_MS_U, KC_WH_R, KC_BTN2, _______},
|
|
|
|
{_______, KC_ACL2, KC_BTN2, _______, KC_BTN1, KC_ACL1, KC_WH_U, KC_MS_L, KC_MS_D, KC_MS_R, KC_BTN4, KC_BTN5},
|
2016-08-06 08:31:35 +02:00
|
|
|
{_______, _______, _______, _______, KC_BTN3, _______, KC_WH_D, KC_BTN1, _______, _______, KC_BTN3, _______},
|
2016-07-26 05:25:03 +02:00
|
|
|
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
|
|
|
|
},
|
|
|
|
|
2016-07-24 04:06:19 +02:00
|
|
|
/* Plover layer (http://opensteno.org)
|
|
|
|
* ,-----------------------------------------------------------------------------------.
|
|
|
|
* | # | # | # | # | # | # | # | # | # | # | # | # |
|
|
|
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
|
|
|
* | | S | T | P | H | * | * | F | P | L | T | D |
|
|
|
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
|
|
|
* |TogOut| S | K | W | R | * | * | R | B | G | S | Z |
|
|
|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
|
|
|
* | Exit | | | A | O | | E | U | | | |
|
|
|
|
* `-----------------------------------------------------------------------------------'
|
|
|
|
*/
|
|
|
|
|
|
|
|
[_PLOVER] = {
|
|
|
|
{KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1 },
|
|
|
|
{XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC},
|
|
|
|
{XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT},
|
|
|
|
{EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX}
|
|
|
|
},
|
|
|
|
|
|
|
|
/* Adjust (Lower + Raise)
|
|
|
|
* ,-----------------------------------------------------------------------------------.
|
2016-07-30 03:02:31 +02:00
|
|
|
* | | | | | | | | | | | | Del |
|
2016-07-24 04:06:19 +02:00
|
|
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
|
|
|
* | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| |
|
|
|
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
|
|
|
* | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | |
|
|
|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
2016-07-30 03:02:31 +02:00
|
|
|
* | | | | | | | | | | |Reset |
|
2016-07-24 04:06:19 +02:00
|
|
|
* `-----------------------------------------------------------------------------------'
|
|
|
|
*/
|
|
|
|
[_ADJUST] = {
|
2016-07-30 03:02:31 +02:00
|
|
|
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL},
|
2016-07-24 04:06:19 +02:00
|
|
|
{_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______},
|
|
|
|
{_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______},
|
2016-07-30 03:02:31 +02:00
|
|
|
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET}
|
2016-07-24 04:06:19 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef AUDIO_ENABLE
|
|
|
|
|
|
|
|
float tone_startup[][2] = SONG(STARTUP_SOUND);
|
|
|
|
float tone_qwerty[][2] = SONG(QWERTY_SOUND);
|
|
|
|
float tone_dvorak[][2] = SONG(DVORAK_SOUND);
|
|
|
|
float tone_colemak[][2] = SONG(COLEMAK_SOUND);
|
|
|
|
float tone_plover[][2] = SONG(PLOVER_SOUND);
|
|
|
|
float tone_plover_gb[][2] = SONG(PLOVER_GOODBYE_SOUND);
|
|
|
|
float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
|
|
|
|
|
|
|
|
float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
|
|
void persistant_default_layer_set(uint16_t default_layer) {
|
|
|
|
eeconfig_update_default_layer(default_layer);
|
|
|
|
default_layer_set(default_layer);
|
|
|
|
}
|
|
|
|
|
|
|
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|
|
|
switch (keycode) {
|
|
|
|
case QWERTY:
|
|
|
|
if (record->event.pressed) {
|
|
|
|
#ifdef AUDIO_ENABLE
|
|
|
|
PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
|
|
|
|
#endif
|
2016-07-29 19:43:59 +02:00
|
|
|
default_layer_set(1UL<<_QWERTY);
|
2016-07-24 04:06:19 +02:00
|
|
|
}
|
|
|
|
return false;
|
|
|
|
break;
|
|
|
|
case COLEMAK:
|
|
|
|
if (record->event.pressed) {
|
|
|
|
#ifdef AUDIO_ENABLE
|
|
|
|
PLAY_NOTE_ARRAY(tone_colemak, false, 0);
|
|
|
|
#endif
|
2016-07-29 19:43:59 +02:00
|
|
|
default_layer_set(1UL<<_COLEMAK);
|
2016-07-24 04:06:19 +02:00
|
|
|
}
|
|
|
|
return false;
|
|
|
|
break;
|
|
|
|
case DVORAK:
|
|
|
|
if (record->event.pressed) {
|
|
|
|
#ifdef AUDIO_ENABLE
|
|
|
|
PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
|
|
|
|
#endif
|
2016-07-29 19:43:59 +02:00
|
|
|
default_layer_set(1UL<<_DVORAK);
|
2016-07-24 04:06:19 +02:00
|
|
|
}
|
|
|
|
return false;
|
|
|
|
break;
|
|
|
|
case LOWER:
|
|
|
|
if (record->event.pressed) {
|
|
|
|
layer_on(_LOWER);
|
|
|
|
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
|
|
|
} else {
|
|
|
|
layer_off(_LOWER);
|
|
|
|
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
break;
|
|
|
|
case RAISE:
|
|
|
|
if (record->event.pressed) {
|
|
|
|
layer_on(_RAISE);
|
|
|
|
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
|
|
|
} else {
|
|
|
|
layer_off(_RAISE);
|
|
|
|
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
break;
|
|
|
|
case BACKLIT:
|
|
|
|
if (record->event.pressed) {
|
|
|
|
register_code(KC_RSFT);
|
|
|
|
#ifdef BACKLIGHT_ENABLE
|
|
|
|
backlight_step();
|
|
|
|
#endif
|
|
|
|
} else {
|
|
|
|
unregister_code(KC_RSFT);
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
break;
|
|
|
|
case PLOVER:
|
|
|
|
if (record->event.pressed) {
|
|
|
|
#ifdef AUDIO_ENABLE
|
|
|
|
stop_all_notes();
|
|
|
|
PLAY_NOTE_ARRAY(tone_plover, false, 0);
|
|
|
|
#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;
|
|
|
|
break;
|
|
|
|
case EXT_PLV:
|
|
|
|
if (record->event.pressed) {
|
|
|
|
#ifdef AUDIO_ENABLE
|
|
|
|
PLAY_NOTE_ARRAY(tone_plover_gb, false, 0);
|
|
|
|
#endif
|
|
|
|
layer_off(_PLOVER);
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
return true;
|
|
|
|
}
|
|
|
|
|
2016-08-01 02:16:25 +02:00
|
|
|
/*
|
|
|
|
* Macro definition
|
|
|
|
*/
|
|
|
|
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
|
|
|
{
|
2016-08-04 05:00:54 +02:00
|
|
|
if (!eeconfig_is_enabled()) {
|
|
|
|
eeconfig_init();
|
|
|
|
}
|
|
|
|
|
|
|
|
bool use_cmd = true; // Use, for example, Cmd-Tab, Cmd-C, Cmd-V, etc.
|
|
|
|
// Compare to MAGIC_SWAP_ALT_GUI and MAGIC_UNSWAP_ALT_GUI configs, set in:
|
|
|
|
// quantum/quantum.c
|
|
|
|
if(keymap_config.swap_lalt_lgui == 1 && keymap_config.swap_ralt_rgui == 1) {
|
|
|
|
use_cmd = false; // ... or, Alt-Tab, Ctrl-C, Ctrl-V, etc.
|
|
|
|
}
|
|
|
|
|
2016-08-01 02:16:25 +02:00
|
|
|
switch (id) {
|
|
|
|
case KC_ALT_TAB:
|
2016-08-04 05:00:54 +02:00
|
|
|
if(use_cmd) { return (record->event.pressed ? MACRO( D(LALT), D(TAB), END ) : MACRO( U(TAB), END )); }
|
|
|
|
else { return (record->event.pressed ? MACRO( D(LGUI), D(TAB), END ) : MACRO( U(TAB), END )); }
|
2016-08-06 09:01:12 +02:00
|
|
|
case KC_CMD_TAB:
|
|
|
|
if(use_cmd) { return (record->event.pressed ? MACRO( D(LGUI), D(TAB), END ) : MACRO( U(TAB), END )); }
|
|
|
|
else { return (record->event.pressed ? MACRO( D(LALT), D(TAB), END ) : MACRO( U(TAB), END )); }
|
2016-08-04 05:00:54 +02:00
|
|
|
|
2016-08-01 02:16:25 +02:00
|
|
|
case KC_CTL_TAB:
|
|
|
|
return (record->event.pressed ? MACRO( D(LCTRL), D(TAB), END ) : MACRO( U(TAB), END ));
|
2016-08-02 07:02:39 +02:00
|
|
|
case KC_CMD_SLSH:
|
|
|
|
return (record->event.pressed ? MACRO( D(LGUI), D(SLSH),END ) : MACRO( U(SLSH),END ));
|
2016-08-04 05:00:54 +02:00
|
|
|
|
|
|
|
case KC_AG_FIND:
|
|
|
|
return use_cmd ? MACRODOWN( D(LGUI), T(F), END ) : MACRODOWN( D(LCTRL), T(F), END );
|
|
|
|
case KC_AG_AGAIN:
|
|
|
|
return use_cmd ? MACRODOWN( D(LGUI), T(G), END ) : MACRODOWN( D(LCTRL), T(G), END );
|
|
|
|
case KC_AG_UNDO:
|
|
|
|
return use_cmd ? MACRODOWN( D(LGUI), T(Z), END ) : MACRODOWN( D(LCTRL), T(Z), END );
|
|
|
|
case KC_AG_CUT:
|
|
|
|
return use_cmd ? MACRODOWN( D(LGUI), T(X), END ) : MACRODOWN( D(LCTRL), T(X), END );
|
|
|
|
case KC_AG_COPY:
|
|
|
|
return use_cmd ? MACRODOWN( D(LGUI), T(C), END ) : MACRODOWN( D(LCTRL), T(C), END );
|
|
|
|
case KC_AG_PASTE:
|
|
|
|
return use_cmd ? MACRODOWN( D(LGUI), T(V), END ) : MACRODOWN( D(LCTRL), T(V), END );
|
2016-08-01 02:16:25 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
return MACRO_NONE;
|
|
|
|
}
|
|
|
|
|
2016-07-24 04:06:19 +02:00
|
|
|
void matrix_init_user(void) {
|
|
|
|
#ifdef AUDIO_ENABLE
|
|
|
|
startup_user();
|
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef AUDIO_ENABLE
|
|
|
|
|
|
|
|
void startup_user()
|
|
|
|
{
|
|
|
|
_delay_ms(20); // gets rid of tick
|
|
|
|
PLAY_NOTE_ARRAY(tone_startup, false, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
void shutdown_user()
|
|
|
|
{
|
|
|
|
PLAY_NOTE_ARRAY(tone_goodbye, false, 0);
|
|
|
|
_delay_ms(150);
|
|
|
|
stop_all_notes();
|
|
|
|
}
|
|
|
|
|
|
|
|
void music_on_user(void)
|
|
|
|
{
|
|
|
|
music_scale_user();
|
|
|
|
}
|
|
|
|
|
|
|
|
void music_scale_user(void)
|
|
|
|
{
|
|
|
|
PLAY_NOTE_ARRAY(music_scale, false, 0);
|
|
|
|
}
|
|
|
|
|
|
|
|
#endif
|