2016-05-09 17:17:15 +00:00
|
|
|
|
|
|
|
#include "planck.h"
|
|
|
|
#include "action_layer.h"
|
2017-07-26 21:41:39 +00:00
|
|
|
#include "keymap_steno.h"
|
2016-05-09 17:17:15 +00:00
|
|
|
#ifdef AUDIO_ENABLE
|
|
|
|
#include "audio.h"
|
|
|
|
#endif
|
2016-05-15 04:27:32 +00:00
|
|
|
|
2016-05-09 17:17:15 +00:00
|
|
|
#include "eeconfig.h"
|
2016-07-30 20:41:26 +00:00
|
|
|
#include "version.h"
|
2016-05-09 17:17:15 +00:00
|
|
|
|
|
|
|
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.
|
2016-07-07 15:33:32 +00:00
|
|
|
#define _QWERTY 10
|
2016-05-09 17:17:15 +00:00
|
|
|
#define _COLEMAK 1
|
|
|
|
#define _DVORAK 2
|
|
|
|
#define _LOWER 3
|
|
|
|
#define _RAISE 4
|
2016-05-15 04:40:59 +00:00
|
|
|
#define _PLOVER 5
|
2016-05-09 17:17:15 +00:00
|
|
|
#define _ADJUST 16
|
|
|
|
|
2016-06-29 22:47:53 +00:00
|
|
|
enum planck_keycodes {
|
|
|
|
QWERTY = SAFE_RANGE,
|
|
|
|
COLEMAK,
|
|
|
|
DVORAK,
|
|
|
|
PLOVER,
|
|
|
|
LOWER,
|
|
|
|
RAISE,
|
|
|
|
BACKLIT,
|
2016-07-07 15:33:32 +00:00
|
|
|
EXT_PLV,
|
|
|
|
RGBLED_TOGGLE,
|
|
|
|
RGBLED_STEP_MODE,
|
|
|
|
RGBLED_INCREASE_HUE,
|
|
|
|
RGBLED_DECREASE_HUE,
|
|
|
|
RGBLED_INCREASE_SAT,
|
|
|
|
RGBLED_DECREASE_SAT,
|
|
|
|
RGBLED_INCREASE_VAL,
|
|
|
|
RGBLED_DECREASE_VAL,
|
2016-06-29 22:47:53 +00:00
|
|
|
};
|
2016-05-09 17:17:15 +00:00
|
|
|
|
|
|
|
// Fillers to make layering more clear
|
|
|
|
#define _______ KC_TRNS
|
|
|
|
#define XXXXXXX KC_NO
|
|
|
|
|
|
|
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
2016-07-07 15:33:32 +00:00
|
|
|
[0] = {
|
2017-07-26 21:41:39 +00:00
|
|
|
{QWERTY, KC_NO, KC_NO, KC_NO, RGBLED_TOGGLE, RGBLED_STEP_MODE, RGBLED_INCREASE_HUE, RGBLED_DECREASE_HUE, RGBLED_INCREASE_SAT, RGBLED_DECREASE_SAT, RGBLED_INCREASE_VAL, RGBLED_DECREASE_VAL},
|
2016-07-07 15:33:32 +00:00
|
|
|
{KC_NO, KC_NO, KC_NO, KC_NO, RGBLED_TOGGLE, RGBLED_STEP_MODE, RGBLED_INCREASE_HUE, RGBLED_DECREASE_HUE, RGBLED_INCREASE_SAT, RGBLED_DECREASE_SAT, RGBLED_INCREASE_VAL, RGBLED_DECREASE_VAL},
|
|
|
|
{KC_NO, KC_NO, KC_NO, KC_NO, RGBLED_TOGGLE, RGBLED_STEP_MODE, RGBLED_INCREASE_HUE, RGBLED_DECREASE_HUE, RGBLED_INCREASE_SAT, RGBLED_DECREASE_SAT, RGBLED_INCREASE_VAL, RGBLED_DECREASE_VAL},
|
|
|
|
{KC_NO, KC_NO, KC_NO, KC_NO, RGBLED_TOGGLE, RGBLED_STEP_MODE, RGBLED_INCREASE_HUE, RGBLED_DECREASE_HUE, RGBLED_INCREASE_SAT, RGBLED_DECREASE_SAT, RGBLED_INCREASE_VAL, RGBLED_DECREASE_VAL}
|
|
|
|
},
|
2016-05-09 17:17:15 +00:00
|
|
|
|
|
|
|
/* Qwerty
|
2016-07-07 15:33:32 +00:00
|
|
|
,-----------------------------------------------------------------------------------.
|
2016-05-09 17:17:15 +00:00
|
|
|
* | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
|
|
|
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
|
|
|
* | Esc | A | S | D | F | G | H | J | K | L | ; | " |
|
|
|
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
2016-07-07 15:33:32 +00:00
|
|
|
* | Shift| Z | X | C | V | B | N | M |, | . | / |Enter |
|
2016-05-09 17:17:15 +00:00
|
|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
|
|
|
* | Brite| Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
|
|
|
|
* `-----------------------------------------------------------------------------------'
|
|
|
|
*/
|
|
|
|
[_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},
|
|
|
|
{KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT},
|
|
|
|
{KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT },
|
2016-08-21 01:32:13 +00:00
|
|
|
{KC_LEAD, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_FN0, KC_FN0, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
|
2016-05-09 17:17:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
/* Colemak
|
|
|
|
* ,-----------------------------------------------------------------------------------.
|
|
|
|
* | 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] = {
|
|
|
|
{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 },
|
2016-08-21 01:32:13 +00:00
|
|
|
{KC_LEAD, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_FN0, KC_FN0, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
|
2016-05-09 17:17:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
/* Dvorak
|
|
|
|
* ,-----------------------------------------------------------------------------------.
|
|
|
|
* | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp |
|
|
|
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
|
|
|
* | 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] = {
|
|
|
|
{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_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 },
|
2016-08-21 01:32:13 +00:00
|
|
|
{KC_LEAD, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_FN0, KC_FN0, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
|
2016-05-09 17:17:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
/* Lower
|
|
|
|
* ,-----------------------------------------------------------------------------------.
|
|
|
|
* | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp |
|
|
|
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
|
|
|
* | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | |
|
|
|
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
2016-05-18 02:17:23 +00:00
|
|
|
* | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter |
|
2016-05-09 17:17:15 +00:00
|
|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
|
|
|
* | | | | | | | | Next | Vol- | Vol+ | Play |
|
|
|
|
* `-----------------------------------------------------------------------------------'
|
|
|
|
*/
|
|
|
|
[_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},
|
|
|
|
{KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE},
|
2016-05-18 02:17:23 +00:00
|
|
|
{_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12,S(KC_NUHS),S(KC_NUBS),_______, _______, _______},
|
2016-05-09 17:17:15 +00:00
|
|
|
{_______, _______, _______, _______, _______, _______, _______, _______, 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 | - | = | [ | ] | \ |
|
|
|
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
2016-05-18 02:17:23 +00:00
|
|
|
* | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter |
|
2016-05-09 17:17:15 +00:00
|
|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
|
|
|
* | | | | | | | | Next | Vol- | Vol+ | Play |
|
|
|
|
* `-----------------------------------------------------------------------------------'
|
|
|
|
*/
|
|
|
|
[_RAISE] = {
|
|
|
|
{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},
|
2016-05-18 02:17:23 +00:00
|
|
|
{_______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUHS, _______, _______, _______},
|
2016-05-09 17:17:15 +00:00
|
|
|
{_______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY}
|
|
|
|
},
|
|
|
|
|
|
|
|
/* Plover layer (http://opensteno.org)
|
|
|
|
* ,-----------------------------------------------------------------------------------.
|
|
|
|
* | # | # | # | # | # | # | # | # | # | # | # | # |
|
|
|
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
|
|
|
* | | S | T | P | H | * | * | F | P | L | T | D |
|
|
|
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
|
|
|
* | | S | K | W | R | * | * | R | B | G | S | Z |
|
|
|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
|
|
|
* | Exit | | | A | O | | E | U | | | |
|
|
|
|
* `-----------------------------------------------------------------------------------'
|
|
|
|
*/
|
|
|
|
|
|
|
|
[_PLOVER] = {
|
2017-07-26 21:41:39 +00:00
|
|
|
{STN_N1, STN_N2, STN_N3, STN_N4, STN_N5, STN_N6, STN_N7, STN_N8, STN_N9, STN_NA, STN_NB, STN_NC },
|
|
|
|
{STN_FN, STN_S1, STN_TL, STN_PL, STN_HL, STN_ST1, STN_ST3, STN_FR, STN_PR, STN_LR, STN_TR, STN_DR },
|
|
|
|
{XXXXXXX, STN_S2, STN_KL, STN_WL, STN_RL, STN_ST2, STN_ST4, STN_RR, STN_BR, STN_GR, STN_SR, STN_ZR },
|
|
|
|
{EXT_PLV, XXXXXXX, XXXXXXX, STN_A, STN_O, XXXXXXX, XXXXXXX, STN_E, STN_U, STN_PWR, STN_RE1, STN_RE2}
|
2016-05-09 17:17:15 +00:00
|
|
|
},
|
|
|
|
|
|
|
|
/* Adjust (Lower + Raise)
|
|
|
|
* ,-----------------------------------------------------------------------------------.
|
|
|
|
* | | Reset| | | | | | | | | | Del |
|
|
|
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
|
|
|
* | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak|Plover| |
|
|
|
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
|
|
|
* | |Voice-|Voice+|Mus on|Musoff| | | | | | | |
|
|
|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
|
|
|
* | | | | | | | | | | | |
|
|
|
|
* `-----------------------------------------------------------------------------------'
|
|
|
|
*/
|
|
|
|
[_ADJUST] = {
|
|
|
|
{_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL},
|
2016-05-15 04:40:59 +00:00
|
|
|
{_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______},
|
2016-05-15 04:51:06 +00:00
|
|
|
{_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______},
|
2016-05-09 17:17:15 +00:00
|
|
|
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
const uint16_t PROGMEM fn_actions[] = {
|
2016-08-21 01:32:13 +00:00
|
|
|
ACTION_SWAP_HANDS_TAP_KEY(KC_SPC),
|
2016-05-09 17:17:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#ifdef AUDIO_ENABLE
|
|
|
|
|
2016-06-15 19:43:40 +00:00
|
|
|
float tone_startup[][2] = SONG(STARTUP_SOUND);
|
2016-05-09 17:17:15 +00:00
|
|
|
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);
|
2016-06-15 19:43:40 +00:00
|
|
|
float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
|
2016-05-09 17:17:15 +00:00
|
|
|
|
2016-06-15 19:43:40 +00:00
|
|
|
float tone_goodbye[][2] = SONG(GOODBYE_SOUND);
|
2016-05-09 17:17:15 +00:00
|
|
|
#endif
|
|
|
|
|
|
|
|
|
2016-06-15 19:43:40 +00:00
|
|
|
|
2017-05-11 19:32:35 +00:00
|
|
|
void persistent_default_layer_set(uint16_t default_layer) {
|
2016-05-09 17:17:15 +00:00
|
|
|
eeconfig_update_default_layer(default_layer);
|
|
|
|
default_layer_set(default_layer);
|
|
|
|
}
|
|
|
|
|
2016-06-29 22:47:53 +00:00
|
|
|
|
|
|
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|
|
|
switch (keycode) {
|
|
|
|
case QWERTY:
|
2016-05-09 17:17:15 +00:00
|
|
|
if (record->event.pressed) {
|
|
|
|
#ifdef AUDIO_ENABLE
|
2017-08-20 06:04:16 +00:00
|
|
|
PLAY_SONG(tone_qwerty);
|
2016-05-09 17:17:15 +00:00
|
|
|
#endif
|
2017-05-11 19:32:35 +00:00
|
|
|
persistent_default_layer_set(1UL<<_QWERTY);
|
2016-05-09 17:17:15 +00:00
|
|
|
}
|
|
|
|
break;
|
2016-06-29 22:47:53 +00:00
|
|
|
return false;
|
|
|
|
case COLEMAK:
|
2016-05-09 17:17:15 +00:00
|
|
|
if (record->event.pressed) {
|
|
|
|
#ifdef AUDIO_ENABLE
|
2017-08-20 06:04:16 +00:00
|
|
|
PLAY_SONG(tone_colemak);
|
2016-05-09 17:17:15 +00:00
|
|
|
#endif
|
2017-05-11 19:32:35 +00:00
|
|
|
persistent_default_layer_set(1UL<<_COLEMAK);
|
2016-05-09 17:17:15 +00:00
|
|
|
}
|
|
|
|
break;
|
2016-06-29 22:47:53 +00:00
|
|
|
return false;
|
|
|
|
case DVORAK:
|
2016-05-09 17:17:15 +00:00
|
|
|
if (record->event.pressed) {
|
|
|
|
#ifdef AUDIO_ENABLE
|
2017-08-20 06:04:16 +00:00
|
|
|
PLAY_SONG(tone_dvorak);
|
2016-05-09 17:17:15 +00:00
|
|
|
#endif
|
2017-05-11 19:32:35 +00:00
|
|
|
persistent_default_layer_set(1UL<<_DVORAK);
|
2016-05-09 17:17:15 +00:00
|
|
|
}
|
|
|
|
break;
|
2016-06-29 22:47:53 +00:00
|
|
|
return false;
|
|
|
|
case LOWER:
|
2016-05-09 17:17:15 +00:00
|
|
|
if (record->event.pressed) {
|
|
|
|
layer_on(_LOWER);
|
2016-05-15 04:51:06 +00:00
|
|
|
#ifdef BACKLIGHT_ENABLE
|
2018-01-01 22:47:51 +00:00
|
|
|
breathing_period_set(2);
|
2016-05-09 17:17:15 +00:00
|
|
|
breathing_pulse();
|
2016-05-15 04:51:06 +00:00
|
|
|
#endif
|
2016-05-09 17:17:15 +00:00
|
|
|
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
|
|
|
} else {
|
|
|
|
layer_off(_LOWER);
|
|
|
|
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
|
|
|
}
|
|
|
|
break;
|
2016-06-29 22:47:53 +00:00
|
|
|
return false;
|
|
|
|
case RAISE:
|
2016-05-09 17:17:15 +00:00
|
|
|
if (record->event.pressed) {
|
|
|
|
layer_on(_RAISE);
|
2016-05-15 04:51:06 +00:00
|
|
|
#ifdef BACKLIGHT_ENABLE
|
2018-01-01 22:47:51 +00:00
|
|
|
breathing_period_set(2);
|
2016-05-09 17:17:15 +00:00
|
|
|
breathing_pulse();
|
2016-05-15 04:51:06 +00:00
|
|
|
#endif
|
2016-05-09 17:17:15 +00:00
|
|
|
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
|
|
|
} else {
|
|
|
|
layer_off(_RAISE);
|
|
|
|
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
|
|
|
}
|
|
|
|
break;
|
2016-06-29 22:47:53 +00:00
|
|
|
return false;
|
|
|
|
case BACKLIT:
|
2016-05-09 17:17:15 +00:00
|
|
|
if (record->event.pressed) {
|
|
|
|
register_code(KC_RSFT);
|
|
|
|
#ifdef BACKLIGHT_ENABLE
|
|
|
|
backlight_step();
|
|
|
|
#endif
|
|
|
|
} else {
|
|
|
|
unregister_code(KC_RSFT);
|
|
|
|
}
|
|
|
|
break;
|
2016-06-29 22:47:53 +00:00
|
|
|
return false;
|
|
|
|
case PLOVER:
|
2017-07-26 21:41:39 +00:00
|
|
|
if (!record->event.pressed) {
|
2016-05-09 17:17:15 +00:00
|
|
|
#ifdef AUDIO_ENABLE
|
|
|
|
stop_all_notes();
|
2017-08-20 06:04:16 +00:00
|
|
|
PLAY_SONG(tone_plover);
|
2016-05-09 17:17:15 +00:00
|
|
|
#endif
|
|
|
|
layer_on(_PLOVER);
|
|
|
|
}
|
|
|
|
break;
|
2016-06-29 22:47:53 +00:00
|
|
|
return false;
|
|
|
|
case EXT_PLV:
|
2016-05-09 17:17:15 +00:00
|
|
|
if (record->event.pressed) {
|
|
|
|
#ifdef AUDIO_ENABLE
|
2017-08-20 06:04:16 +00:00
|
|
|
PLAY_SONG(tone_plover_gb);
|
2016-05-09 17:17:15 +00:00
|
|
|
#endif
|
|
|
|
layer_off(_PLOVER);
|
|
|
|
}
|
|
|
|
break;
|
2016-06-29 22:47:53 +00:00
|
|
|
return false;
|
2016-05-09 17:17:15 +00:00
|
|
|
|
2016-07-07 15:33:32 +00:00
|
|
|
case RGBLED_TOGGLE:
|
|
|
|
//led operations
|
|
|
|
if (record->event.pressed) {
|
|
|
|
rgblight_toggle();
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
break;
|
|
|
|
case RGBLED_INCREASE_HUE:
|
|
|
|
if (record->event.pressed) {
|
|
|
|
rgblight_increase_hue();
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
break;
|
|
|
|
case RGBLED_DECREASE_HUE:
|
|
|
|
if (record->event.pressed) {
|
|
|
|
rgblight_decrease_hue();
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
break;
|
|
|
|
case RGBLED_INCREASE_SAT:
|
|
|
|
if (record->event.pressed) {
|
|
|
|
rgblight_increase_sat();
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
break;
|
|
|
|
case RGBLED_DECREASE_SAT:
|
|
|
|
if (record->event.pressed) {
|
|
|
|
rgblight_decrease_sat();
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
break;
|
|
|
|
case RGBLED_INCREASE_VAL:
|
|
|
|
if (record->event.pressed) {
|
|
|
|
rgblight_increase_val();
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
break;
|
|
|
|
case RGBLED_DECREASE_VAL:
|
|
|
|
if (record->event.pressed) {
|
|
|
|
rgblight_decrease_val();
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
break;
|
|
|
|
case RGBLED_STEP_MODE:
|
|
|
|
if (record->event.pressed) {
|
|
|
|
rgblight_step();
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
break;
|
|
|
|
|
|
|
|
|
2016-05-09 17:17:15 +00:00
|
|
|
}
|
2016-06-29 22:47:53 +00:00
|
|
|
return true;
|
2016-05-09 17:17:15 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
void matrix_init_user(void) {
|
|
|
|
#ifdef AUDIO_ENABLE
|
2016-06-15 19:43:40 +00:00
|
|
|
startup_user();
|
2016-05-09 17:17:15 +00:00
|
|
|
#endif
|
|
|
|
}
|
|
|
|
|
|
|
|
#ifdef AUDIO_ENABLE
|
2016-06-15 19:43:40 +00:00
|
|
|
void startup_user()
|
|
|
|
{
|
|
|
|
_delay_ms(20); // gets rid of tick
|
2017-08-20 06:04:16 +00:00
|
|
|
PLAY_SONG(tone_startup);
|
2016-06-15 19:43:40 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
void shutdown_user()
|
|
|
|
{
|
2017-08-20 06:04:16 +00:00
|
|
|
PLAY_SONG(tone_goodbye);
|
2016-05-15 04:27:32 +00:00
|
|
|
_delay_ms(150);
|
2016-06-15 19:43:40 +00:00
|
|
|
stop_all_notes();
|
|
|
|
}
|
|
|
|
|
|
|
|
void music_on_user(void)
|
|
|
|
{
|
|
|
|
music_scale_user();
|
|
|
|
}
|
|
|
|
|
|
|
|
void music_scale_user(void)
|
|
|
|
{
|
2017-08-20 06:04:16 +00:00
|
|
|
PLAY_SONG(music_scale);
|
2016-06-15 19:43:40 +00:00
|
|
|
}
|
|
|
|
|
2016-05-15 04:27:32 +00:00
|
|
|
#endif
|
2016-05-09 17:17:15 +00:00
|
|
|
|
2016-05-15 04:27:32 +00:00
|
|
|
LEADER_EXTERNS();
|
2016-05-09 17:17:15 +00:00
|
|
|
|
2016-05-15 04:27:32 +00:00
|
|
|
void matrix_scan_user(void) {
|
2017-07-26 21:41:39 +00:00
|
|
|
LEADER_DICTIONARY() {
|
2016-05-15 04:27:32 +00:00
|
|
|
leading = false;
|
2017-07-26 21:41:39 +00:00
|
|
|
leader_end();
|
2016-05-15 04:27:32 +00:00
|
|
|
|
2016-06-29 22:29:20 +00:00
|
|
|
SEQ_ONE_KEY (KC_R) {
|
|
|
|
tap_random_base64();
|
|
|
|
tap_random_base64();
|
|
|
|
tap_random_base64();
|
|
|
|
tap_random_base64();
|
|
|
|
tap_random_base64();
|
|
|
|
tap_random_base64();
|
|
|
|
tap_random_base64();
|
|
|
|
tap_random_base64();
|
|
|
|
tap_random_base64();
|
|
|
|
}
|
2016-06-15 19:43:40 +00:00
|
|
|
SEQ_ONE_KEY (KC_V) {
|
|
|
|
SEND_STRING (QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION);
|
|
|
|
}
|
2016-05-15 04:27:32 +00:00
|
|
|
SEQ_ONE_KEY(KC_F) {
|
Makefile redo & other features (#395)
* .build containment implemented
* no destructive variable setting - builds in either folder
* make from 3 places
* cleans before each build
* make from root with keyboard=keyboard, keymap=keymap
* make from keyboard/keyboard with keymap=keymap
* make from keymaps/keymap
* only implemented on planck
* adds color diag to avr-gcc
* makefiles for all plancks, clean-up
* quick build-all makefile for plancks
* reformatting of make output (colors)
* color toggle, tmk path corrections
* correct if statement for color
* move config.h to main makefile, updates preonic, atomic
* format update, all keyboards targets
* makefile optional for build all target, alps and arrow_pad updated
* alps updated
* make planck default, trying out travis recipe for all-keyboards
* all-keymaps target, different travis recipe
* updates alps64
* updates keyboards to new format
* updates clue* projects
* all projects updated, specialise EZ .hex, let .hex through
* updates travis
* automatically find root, keyboard, keymap
* silent echo, cleaned-up mass make output
* updates all keyboards' .hex files except EZ
* Rename Bantam44.c to bantam44.c
* Rename Bantam44.h to bantam44.h
* nananana
* adds six key keyboard
* does same to ez as rest
* updates send_string example
* brings ergodox_ez up to date
* updates template/new project script
* adds sixkeyboard
* adds readme for sixkeyboard
* adds sixkeyboard to travis
* filenames, gitignore mess
* define clock prescaler stuff manually
* make quick, size test example
* documentation and dfu-no-build
2016-06-11 17:31:31 +00:00
|
|
|
SEND_STRING("if yes\n\tpeanut butter\nelse\n\trice snacks");
|
2016-05-15 04:27:32 +00:00
|
|
|
}
|
|
|
|
SEQ_TWO_KEYS(KC_A, KC_S) {
|
|
|
|
register_code(KC_H);
|
|
|
|
unregister_code(KC_H);
|
|
|
|
}
|
|
|
|
SEQ_THREE_KEYS(KC_A, KC_S, KC_D) {
|
|
|
|
register_code(KC_LGUI);
|
|
|
|
register_code(KC_S);
|
|
|
|
unregister_code(KC_S);
|
|
|
|
unregister_code(KC_LGUI);
|
2016-05-09 17:17:15 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|