|
|
@ -11,15 +11,17 @@ extern keymap_config_t keymap_config;
|
|
|
|
// The underscores don't mean anything - you can have a layer called STUFF or any other name.
|
|
|
|
// 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
|
|
|
|
// Layer names don't all need to be of the same length, obviously, and you can also skip them
|
|
|
|
// entirely and just use numbers.
|
|
|
|
// entirely and just use numbers.
|
|
|
|
#define _DVORAK 0
|
|
|
|
#define _QWERTY 0
|
|
|
|
#define _QWERTY 1
|
|
|
|
#define _COLEMAK 1
|
|
|
|
#define _LOWER 2
|
|
|
|
#define _DVORAK 2
|
|
|
|
#define _RAISE 3
|
|
|
|
#define _LOWER 3
|
|
|
|
|
|
|
|
#define _RAISE 4
|
|
|
|
#define _ADJUST 16
|
|
|
|
#define _ADJUST 16
|
|
|
|
|
|
|
|
|
|
|
|
enum planck_keycodes {
|
|
|
|
enum planck_keycodes {
|
|
|
|
DVORAK = SAFE_RANGE,
|
|
|
|
QWERTY = SAFE_RANGE,
|
|
|
|
QWERTY,
|
|
|
|
COLEMAK,
|
|
|
|
|
|
|
|
DVORAK,
|
|
|
|
LOWER,
|
|
|
|
LOWER,
|
|
|
|
RAISE,
|
|
|
|
RAISE,
|
|
|
|
BACKLIT
|
|
|
|
BACKLIT
|
|
|
@ -31,40 +33,58 @@ enum planck_keycodes {
|
|
|
|
|
|
|
|
|
|
|
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|
|
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|
|
|
|
|
|
|
|
|
|
|
/* Dvorak
|
|
|
|
/* Qwerty
|
|
|
|
* ,-----------------------------------------------------------------------------------.
|
|
|
|
* ,-----------------------------------------------------------------------------------.
|
|
|
|
* | Tab | " | , | . | P | Y | F | G | C | R | L | Bksp |
|
|
|
|
* | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
|
|
|
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
|
|
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
|
|
|
* | Esc | A | O | E | U | I | D | H | T | N | S | - |
|
|
|
|
* | Esc | A | S | D | F | G | H | J | K | L | ; | " |
|
|
|
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
|
|
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
|
|
|
* | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter |
|
|
|
|
* | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
|
|
|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
|
|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
|
|
|
* | ` | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
|
|
|
|
* | ` | Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right |
|
|
|
|
* `-----------------------------------------------------------------------------------'
|
|
|
|
* `-----------------------------------------------------------------------------------'
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
[_DVORAK] = {
|
|
|
|
[_QWERTY] = {
|
|
|
|
{KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC},
|
|
|
|
{ALL_T(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_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS},
|
|
|
|
{CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT},
|
|
|
|
{SFT_T(KC_ESC), KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_T(KC_ENT)},
|
|
|
|
{SFT_T(KC_ESC), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT)},
|
|
|
|
{ALL_T(KC_GRV), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
|
|
|
|
{MEH_T(KC_GRV), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
/* Qwerty
|
|
|
|
/* Colemak
|
|
|
|
* ,-----------------------------------------------------------------------------------.
|
|
|
|
* ,-----------------------------------------------------------------------------------.
|
|
|
|
* | Tab | Q | W | E | R | T | Y | U | I | O | P | Bksp |
|
|
|
|
* | Tab | Q | W | F | P | G | J | L | U | Y | ; | Bksp |
|
|
|
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
|
|
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
|
|
|
* | Esc | A | S | D | F | G | H | J | K | L | ; | " |
|
|
|
|
* | Esc | A | R | S | T | D | H | N | E | I | O | " |
|
|
|
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
|
|
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
|
|
|
* | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
|
|
|
|
* | Shift| Z | X | C | V | B | K | M | , | . | / |Enter |
|
|
|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
|
|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
|
|
|
* | ` | Ctrl | Alt | GUI |Lower | Space |Raise | Left | Down | Up |Right |
|
|
|
|
* | ` | Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right |
|
|
|
|
* `-----------------------------------------------------------------------------------'
|
|
|
|
* `-----------------------------------------------------------------------------------'
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
[_QWERTY] = {
|
|
|
|
[_COLEMAK] = {
|
|
|
|
{_______, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC},
|
|
|
|
{ALL_T(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_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT},
|
|
|
|
{CTL_T(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_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, _______},
|
|
|
|
{SFT_T(KC_ESC), KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT)},
|
|
|
|
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
|
|
|
|
{MEH_T(KC_GRV), 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 |
|
|
|
|
|
|
|
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
|
|
|
|
|
|
|
* | Esc | A | O | E | U | I | D | H | T | N | S | - |
|
|
|
|
|
|
|
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
|
|
|
|
|
|
|
* | Shift| ; | Q | J | K | X | B | M | W | V | Z |Enter |
|
|
|
|
|
|
|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
|
|
|
|
|
|
|
* | ` | Ctrl | Alt | GUI |Lower |Space |Space |Raise | Left | Down | Up |Right |
|
|
|
|
|
|
|
|
* `-----------------------------------------------------------------------------------'
|
|
|
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
[_DVORAK] = {
|
|
|
|
|
|
|
|
{ALL_T(KC_TAB), KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC},
|
|
|
|
|
|
|
|
{CTL_T(KC_ESC), KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_MINS},
|
|
|
|
|
|
|
|
{SFT_T(KC_ESC), KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_T(KC_ENT)},
|
|
|
|
|
|
|
|
{MEH_T(KC_GRV), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
|
|
|
|
},
|
|
|
|
},
|
|
|
|
|
|
|
|
|
|
|
|
/* Lower
|
|
|
|
/* Lower
|
|
|
@ -107,7 +127,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|
|
|
* ,-----------------------------------------------------------------------------------.
|
|
|
|
* ,-----------------------------------------------------------------------------------.
|
|
|
|
* | | Reset| | | | | | | | | | Del |
|
|
|
|
* | | Reset| | | | | | | | | | Del |
|
|
|
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
|
|
|
* |------+------+------+------+------+-------------+------+------+------+------+------|
|
|
|
|
* | | | |Aud on|Audoff|AGnorm|AGswap|Dvorak|Qwerty| | | |
|
|
|
|
* | | | |Aud on|Audoff|AGnorm|AGswap|Qwerty|Colemk|Dvorak| | |
|
|
|
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
|
|
|
* |------+------+------+------+------+------|------+------+------+------+------+------|
|
|
|
|
* | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | |
|
|
|
|
* | |Voice-|Voice+|Mus on|Musoff|MIDIon|MIDIof| | | | | |
|
|
|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
|
|
|
* |------+------+------+------+------+------+------+------+------+------+------+------|
|
|
|
@ -116,7 +136,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
[_ADJUST] = {
|
|
|
|
[_ADJUST] = {
|
|
|
|
{_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL},
|
|
|
|
{_______, RESET, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL},
|
|
|
|
{_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, DVORAK, QWERTY, _______, _______, _______},
|
|
|
|
{_______, _______, _______, AU_ON, AU_OFF, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, _______, _______},
|
|
|
|
{_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______},
|
|
|
|
{_______, MUV_DE, MUV_IN, MU_ON, MU_OFF, MI_ON, MI_OFF, _______, _______, _______, _______, _______},
|
|
|
|
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
|
|
|
|
{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}
|
|
|
|
}
|
|
|
|
}
|
|
|
@ -128,6 +148,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|
|
|
|
|
|
|
|
|
|
|
float tone_startup[][2] = SONG(STARTUP_SOUND);
|
|
|
|
float tone_startup[][2] = SONG(STARTUP_SOUND);
|
|
|
|
float tone_qwerty[][2] = SONG(QWERTY_SOUND);
|
|
|
|
float tone_qwerty[][2] = SONG(QWERTY_SOUND);
|
|
|
|
|
|
|
|
float tone_colemak[][2] = SONG(COLEMAK_SOUND);
|
|
|
|
float tone_dvorak[][2] = SONG(DVORAK_SOUND);
|
|
|
|
float tone_dvorak[][2] = SONG(DVORAK_SOUND);
|
|
|
|
float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
|
|
|
|
float music_scale[][2] = SONG(MUSIC_SCALE_SOUND);
|
|
|
|
|
|
|
|
|
|
|
@ -142,21 +163,30 @@ void persistant_default_layer_set(uint16_t default_layer) {
|
|
|
|
|
|
|
|
|
|
|
|
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 DVORAK:
|
|
|
|
case QWERTY:
|
|
|
|
if (record->event.pressed) {
|
|
|
|
if (record->event.pressed) {
|
|
|
|
#ifdef AUDIO_ENABLE
|
|
|
|
#ifdef AUDIO_ENABLE
|
|
|
|
PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
|
|
|
|
PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
persistant_default_layer_set(1UL<<_DVORAK);
|
|
|
|
persistant_default_layer_set(1UL<<_QWERTY);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|
case QWERTY:
|
|
|
|
case COLEMAK:
|
|
|
|
if (record->event.pressed) {
|
|
|
|
if (record->event.pressed) {
|
|
|
|
#ifdef AUDIO_ENABLE
|
|
|
|
#ifdef AUDIO_ENABLE
|
|
|
|
PLAY_NOTE_ARRAY(tone_qwerty, false, 0);
|
|
|
|
PLAY_NOTE_ARRAY(tone_colemak, false, 0);
|
|
|
|
#endif
|
|
|
|
#endif
|
|
|
|
persistant_default_layer_set(1UL<<_QWERTY);
|
|
|
|
persistant_default_layer_set(1UL<<_COLEMAK);
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
break;
|
|
|
|
|
|
|
|
case DVORAK:
|
|
|
|
|
|
|
|
if (record->event.pressed) {
|
|
|
|
|
|
|
|
#ifdef AUDIO_ENABLE
|
|
|
|
|
|
|
|
PLAY_NOTE_ARRAY(tone_dvorak, false, 0);
|
|
|
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
persistant_default_layer_set(1UL<<_DVORAK);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
break;
|
|
|
|
break;
|
|
|
|