updates preonic default layout
This commit is contained in:
parent
00dcac7270
commit
0058c33815
2 changed files with 40 additions and 32 deletions
|
@ -30,8 +30,7 @@ enum planck_keycodes {
|
||||||
LOWER,
|
LOWER,
|
||||||
RAISE,
|
RAISE,
|
||||||
BACKLIT,
|
BACKLIT,
|
||||||
EXT_PLV,
|
EXT_PLV
|
||||||
TOG_OUT
|
|
||||||
};
|
};
|
||||||
|
|
||||||
// Fillers to make layering more clear
|
// Fillers to make layering more clear
|
||||||
|
@ -145,7 +144,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
[_PLOVER] = {
|
[_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 },
|
{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_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC},
|
||||||
{TOG_OUT, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT},
|
{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}
|
{EXT_PLV, XXXXXXX, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX, XXXXXXX}
|
||||||
},
|
},
|
||||||
|
|
||||||
|
@ -199,6 +198,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
persistant_default_layer_set(1UL<<_QWERTY);
|
persistant_default_layer_set(1UL<<_QWERTY);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
return false;
|
||||||
case COLEMAK:
|
case COLEMAK:
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
#ifdef AUDIO_ENABLE
|
#ifdef AUDIO_ENABLE
|
||||||
|
@ -207,6 +207,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
persistant_default_layer_set(1UL<<_COLEMAK);
|
persistant_default_layer_set(1UL<<_COLEMAK);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
return false;
|
||||||
case DVORAK:
|
case DVORAK:
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
#ifdef AUDIO_ENABLE
|
#ifdef AUDIO_ENABLE
|
||||||
|
@ -215,6 +216,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
persistant_default_layer_set(1UL<<_DVORAK);
|
persistant_default_layer_set(1UL<<_DVORAK);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
return false;
|
||||||
case LOWER:
|
case LOWER:
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
layer_on(_LOWER);
|
layer_on(_LOWER);
|
||||||
|
@ -224,6 +226,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
return false;
|
||||||
case RAISE:
|
case RAISE:
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
layer_on(_RAISE);
|
layer_on(_RAISE);
|
||||||
|
@ -233,6 +236,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
return false;
|
||||||
case BACKLIT:
|
case BACKLIT:
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
register_code(KC_RSFT);
|
register_code(KC_RSFT);
|
||||||
|
@ -243,6 +247,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
unregister_code(KC_RSFT);
|
unregister_code(KC_RSFT);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
return false;
|
||||||
case PLOVER:
|
case PLOVER:
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
#ifdef AUDIO_ENABLE
|
#ifdef AUDIO_ENABLE
|
||||||
|
@ -261,6 +266,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
eeconfig_update_keymap(keymap_config.raw);
|
eeconfig_update_keymap(keymap_config.raw);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
return false;
|
||||||
case EXT_PLV:
|
case EXT_PLV:
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
#ifdef AUDIO_ENABLE
|
#ifdef AUDIO_ENABLE
|
||||||
|
@ -269,11 +275,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
layer_off(_PLOVER);
|
layer_off(_PLOVER);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case TOG_OUT:
|
return false;
|
||||||
if (record->event.pressed) {
|
|
||||||
return MACRO( D(E), D(R), D(F), D(V), D(O), D(L), U(E), U(R), U(F), U(V), U(O), U(L), END );
|
|
||||||
}
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
|
@ -16,13 +16,14 @@
|
||||||
#define _RAISE 4
|
#define _RAISE 4
|
||||||
#define _ADJUST 16
|
#define _ADJUST 16
|
||||||
|
|
||||||
// Macro name shortcuts
|
enum planck_keycodes {
|
||||||
#define QWERTY M(_QWERTY)
|
QWERTY = SAFE_RANGE,
|
||||||
#define COLEMAK M(_COLEMAK)
|
COLEMAK,
|
||||||
#define DVORAK M(_DVORAK)
|
DVORAK,
|
||||||
#define LOWER M(_LOWER)
|
LOWER,
|
||||||
#define RAISE M(_RAISE)
|
RAISE,
|
||||||
#define M_BL 5
|
BACKLIT
|
||||||
|
};
|
||||||
|
|
||||||
// Fillers to make layering more clear
|
// Fillers to make layering more clear
|
||||||
#define _______ KC_TRNS
|
#define _______ KC_TRNS
|
||||||
|
@ -48,7 +49,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
{KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL},
|
{KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_DEL},
|
||||||
{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_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 },
|
{KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT },
|
||||||
{M(M_BL), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
|
{BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
|
||||||
},
|
},
|
||||||
|
|
||||||
/* Colemak
|
/* Colemak
|
||||||
|
@ -69,7 +70,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
{KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_DEL},
|
{KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_DEL},
|
||||||
{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_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 },
|
{KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT },
|
||||||
{M(M_BL), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
|
{BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
|
||||||
},
|
},
|
||||||
|
|
||||||
/* Dvorak
|
/* Dvorak
|
||||||
|
@ -90,7 +91,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
||||||
{KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_DEL},
|
{KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_DEL},
|
||||||
{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_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 },
|
{KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_ENT },
|
||||||
{M(M_BL), KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
|
{BACKLIT, KC_LCTL, KC_LALT, KC_LGUI, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT}
|
||||||
},
|
},
|
||||||
|
|
||||||
/* Lower
|
/* Lower
|
||||||
|
@ -185,10 +186,9 @@ void persistant_default_layer_set(uint16_t default_layer) {
|
||||||
default_layer_set(default_layer);
|
default_layer_set(default_layer);
|
||||||
}
|
}
|
||||||
|
|
||||||
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
||||||
{
|
switch (keycode) {
|
||||||
switch(id) {
|
case QWERTY:
|
||||||
case _QWERTY:
|
|
||||||
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_qwerty, false, 0);
|
||||||
|
@ -196,7 +196,8 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||||
persistant_default_layer_set(1UL<<_QWERTY);
|
persistant_default_layer_set(1UL<<_QWERTY);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case _COLEMAK:
|
return false;
|
||||||
|
case COLEMAK:
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
#ifdef AUDIO_ENABLE
|
#ifdef AUDIO_ENABLE
|
||||||
PLAY_NOTE_ARRAY(tone_colemak, false, 0);
|
PLAY_NOTE_ARRAY(tone_colemak, false, 0);
|
||||||
|
@ -204,7 +205,8 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||||
persistant_default_layer_set(1UL<<_COLEMAK);
|
persistant_default_layer_set(1UL<<_COLEMAK);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case _DVORAK:
|
return false;
|
||||||
|
case DVORAK:
|
||||||
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_dvorak, false, 0);
|
||||||
|
@ -212,7 +214,8 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||||
persistant_default_layer_set(1UL<<_DVORAK);
|
persistant_default_layer_set(1UL<<_DVORAK);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case _LOWER:
|
return false;
|
||||||
|
case LOWER:
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
layer_on(_LOWER);
|
layer_on(_LOWER);
|
||||||
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||||
|
@ -221,7 +224,8 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||||
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case _RAISE:
|
return false;
|
||||||
|
case RAISE:
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
layer_on(_RAISE);
|
layer_on(_RAISE);
|
||||||
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||||
|
@ -230,7 +234,8 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||||
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
update_tri_layer(_LOWER, _RAISE, _ADJUST);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case M_BL:
|
return false;
|
||||||
|
case BACKLIT:
|
||||||
if (record->event.pressed) {
|
if (record->event.pressed) {
|
||||||
register_code(KC_RSFT);
|
register_code(KC_RSFT);
|
||||||
#ifdef BACKLIGHT_ENABLE
|
#ifdef BACKLIGHT_ENABLE
|
||||||
|
@ -240,8 +245,9 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
|
||||||
unregister_code(KC_RSFT);
|
unregister_code(KC_RSFT);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
return MACRO_NONE;
|
return true;
|
||||||
};
|
};
|
||||||
|
|
||||||
void matrix_init_user(void) {
|
void matrix_init_user(void) {
|
||||||
|
|
Loading…
Reference in a new issue