Keymap: Changed to use LAYOUT_kc() macro instead of LAYOUT() macro for easy maintenance. (#4676)

pull/4680/head
Takeshi ISHII 6 years ago committed by Drashna Jaelre
parent eeda99bf2e
commit 9eedaa8802

@ -47,22 +47,25 @@ enum custom_keycodes {
DVORAK,
EUCALYN,
KEYPAD,
EISU,
KANA,
ZERO2,
KC_xEISU,
KC_xKANA,
KC_ZERO2,
RGBRST
};
enum macro_keycodes {
KC_SAMPLEMACRO,
};
// Fillers to make layering more clear
#define _______ KC_TRNS
#define XXXXXXX KC_NO
//Macros
#define M_SAMPLE M(KC_SAMPLEMACRO)
#define KC_LOWER MO(_LOWER)
#define KC_RABS LT(_RAISE,KC_BSPC)
#define KC_RAEN LT(_RAISE,KC_ENT)
#define KC_FF12 LT(_PADFUNC,KC_F12)
#define KC_____ _______
#define KC_XXXX XXXXXXX
#define KC_ADJ MO(_ADJUST)
#define KC_LSMI LSFT(KC_MINS)
#define KC_LSEQ LSFT(KC_EQL)
#define KC_LSRB LSFT(KC_RBRC)
#define KC_LSLB LSFT(KC_LBRC)
#define ___ _______
#if HELIX_ROWS == 5
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
@ -80,13 +83,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |Lower | Lower| Caps | Alt | GUI | Space| BS | Enter| Space| GUI | Alt | Menu |Lower |Lower |
* `-------------------------------------------------------------------------------------------------'
*/
[_QWERTY] = LAYOUT( \
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \
KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSLS, \
KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_RCTL, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_GRV, KC_QUOT, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \
MO(_LOWER),MO(_LOWER), KC_CAPS, KC_LALT, KC_LGUI, KC_SPC, LT(_RAISE,KC_BSPC), \
LT(_RAISE,KC_ENT), KC_SPC, KC_RGUI, KC_RALT, KC_APP,MO(_LOWER),MO(_LOWER) \
[_QWERTY] = LAYOUT_kc( \
ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, BSPC, \
TAB, Q, W, E, R, T, Y, U, I, O, P, BSLS, \
LCTL, A, S, D, F, G, H, J, K, L, SCLN, RCTL, \
LSFT, Z, X, C, V, B, GRV, QUOT, N, M, COMM, DOT, SLSH, RSFT, \
LOWER, LOWER, CAPS, LALT, LGUI, SPC, RABS, RAEN, SPC, RGUI, RALT, APP,LOWER, LOWER \
),
/* Colemak
@ -102,13 +104,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |Lower | Lower| Caps | Alt | GUI | Space| BS | Enter| Space| GUI | Alt | Menu |Lower |Lower |
* `-------------------------------------------------------------------------------------------------'
*/
[_COLEMAK] = LAYOUT( \
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \
KC_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSLS, \
KC_LCTL, KC_A, KC_R, KC_S, KC_T, KC_D, KC_H, KC_N, KC_E, KC_I, KC_O, KC_RCTL, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_GRV, KC_QUOT, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSFT, \
MO(_LOWER),MO(_LOWER), KC_CAPS, KC_LALT, KC_LGUI, KC_SPC, LT(_RAISE,KC_BSPC), \
LT(_RAISE,KC_ENT), KC_SPC, KC_RGUI, KC_RALT, KC_APP,MO(_LOWER),MO(_LOWER) \
[_COLEMAK] = LAYOUT_kc( \
ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, BSPC, \
TAB, Q, W, F, P, G, J, L, U, Y, SCLN, BSLS, \
LCTL, A, R, S, T, D, H, N, E, I, O, RCTL, \
LSFT, Z, X, C, V, B, GRV, QUOT, K, M, COMM, DOT, SLSH, RSFT, \
LOWER, LOWER, CAPS, LALT, LGUI, SPC, RABS, RAEN, SPC, RGUI, RALT, APP,LOWER, LOWER \
),
/* Dvorak
@ -124,13 +125,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |Lower | Lower| Caps | Alt | GUI | Space| BS | Enter| Space| GUI | Alt | Menu |Lower |Lower |
* `-------------------------------------------------------------------------------------------------'
*/
[_DVORAK] = LAYOUT( \
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \
KC_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSLS, \
KC_LCTL, KC_A, KC_O, KC_E, KC_U, KC_I, KC_D, KC_H, KC_T, KC_N, KC_S, KC_RCTL, \
KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_GRV, KC_SLSH, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RSFT, \
MO(_LOWER),MO(_LOWER), KC_CAPS, KC_LALT, KC_LGUI, KC_SPC, LT(_RAISE,KC_BSPC), \
LT(_RAISE,KC_ENT), KC_SPC, KC_RGUI, KC_RALT, KC_APP,MO(_LOWER),MO(_LOWER) \
[_DVORAK] = LAYOUT_kc( \
ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, BSPC, \
TAB, QUOT, COMM, DOT, P, Y, F, G, C, R, L, BSLS, \
LCTL, A, O, E, U, I, D, H, T, N, S, RCTL, \
LSFT, SCLN, Q, J, K, X, GRV, SLSH, B, M, W, V, Z, RSFT, \
LOWER, LOWER, CAPS, LALT, LGUI, SPC, RABS, RAEN, SPC, RGUI, RALT, APP,LOWER, LOWER \
),
/* Eucalyn (http://eucalyn.hatenadiary.jp/entry/about-eucalyn-layout)
@ -146,13 +146,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* |Lower | Lower| Caps | Alt | GUI | Space| BS | Enter| Space| GUI | Alt | Menu |Lower |Lower |
* `-------------------------------------------------------------------------------------------------'
*/
[_EUCALYN] = LAYOUT( \
KC_ESC, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, \
KC_TAB, KC_Q, KC_W, KC_COMM, KC_DOT, KC_SCLN, KC_M, KC_R, KC_D, KC_Y, KC_P, KC_BSLS, \
KC_LCTL, KC_A, KC_O, KC_E, KC_I, KC_U, KC_G, KC_T, KC_K, KC_S, KC_N, KC_RCTL, \
KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_F, KC_GRV, KC_QUOT, KC_B, KC_H, KC_J, KC_L, KC_SLSH, KC_RSFT, \
MO(_LOWER),MO(_LOWER), KC_CAPS, KC_LALT, KC_LGUI, KC_SPC, LT(_RAISE,KC_BSPC), \
LT(_RAISE,KC_ENT), KC_SPC, KC_RGUI, KC_RALT, KC_APP,MO(_LOWER),MO(_LOWER) \
[_EUCALYN] = LAYOUT_kc( \
ESC, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, BSPC, \
TAB, Q, W, COMM, DOT, SCLN, M, R, D, Y, P, BSLS, \
LCTL, A, O, E, I, U, G, T, K, S, N, RCTL, \
LSFT, Z, X, C, V, F, GRV, QUOT, B, H, J, L, SLSH, RSFT, \
LOWER, LOWER, CAPS, LALT, LGUI, SPC, RABS, RAEN, SPC, RGUI, RALT, APP,LOWER, LOWER \
),
/* Keypad
@ -168,13 +167,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | 0 | , | . | Enter| F5 | F10 | F12 | F12 | F5 | F10 | Enter| 0 | , | . |
* `-------------------------------------------------------------------------------------------------'
*/
[_KEYPAD] = LAYOUT( \
KC_TAB, KC_PSLS, KC_PAST, KC_DEL, KC_F1, KC_F6, KC_F1, KC_F6, KC_DEL, KC_TAB, KC_PSLS, KC_PAST, \
KC_KP_7, KC_KP_8, KC_KP_9, KC_BSPC, KC_F2, KC_F7, KC_F2, KC_F7, KC_BSPC, KC_KP_7, KC_KP_8, KC_KP_9, \
KC_KP_4, KC_KP_5, KC_KP_6, KC_PMNS, KC_F3, KC_F8, KC_F3, KC_F8, KC_PMNS, KC_KP_4, KC_KP_5, KC_KP_6, \
KC_KP_1, KC_KP_2, KC_KP_3, KC_PPLS, KC_F4, KC_F9, KC_F11, KC_F11, KC_F4, KC_F9, KC_PPLS, KC_KP_1, KC_KP_2, KC_KP_3, \
KC_KP_0, KC_COMM, KC_PDOT, KC_PENT, KC_F5, KC_F10, LT(_PADFUNC,KC_F12),
LT(_PADFUNC,KC_F12),KC_F5, KC_F10, KC_PENT, KC_KP_0, KC_COMM, KC_PDOT \
[_KEYPAD] = LAYOUT_kc( \
TAB, PSLS, PAST, DEL, F1, F6, F1, F6, DEL, TAB, PSLS, PAST, \
KP_7, KP_8, KP_9, BSPC, F2, F7, F2, F7, BSPC, KP_7, KP_8, KP_9, \
KP_4, KP_5, KP_6, PMNS, F3, F8, F3, F8, PMNS, KP_4, KP_5, KP_6, \
KP_1, KP_2, KP_3, PPLS, F4, F9, F11, F11, F4, F9, PPLS, KP_1, KP_2, KP_3, \
KP_0, COMM, PDOT, PENT, F5, F10, FF12, FF12, F5, F10, PENT, KP_0, COMM, PDOT \
),
/* AUX modifier key layer
@ -190,12 +188,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | 00 | | | | | | | | | | | 00 | |
* `-------------------------------------------------------------------------------------------------'
*/
[_KAUX] = LAYOUT( \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, ZERO2, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, ZERO2, _______ \
[_KAUX] = LAYOUT_kc( \
____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \
____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \
____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \
____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \
____,ZERO2, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ZERO2,____ \
),
/* Keypad function layer
@ -211,13 +209,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | | | | | | | | |
* `-------------------------------------------------------------------------------------------------'
*/
[_PADFUNC] = LAYOUT( \
XXXXXXX, XXXXXXX, XXXXXXX, KC_PAUS, KC_SLCK, KC_PSCR, KC_PSCR, KC_SLCK, KC_PAUS, XXXXXXX, XXXXXXX, XXXXXXX, \
XXXXXXX, XXXXXXX, XXXXXXX, KC_HOME, KC_UP, KC_PGUP, KC_PGUP, KC_UP, KC_HOME, XXXXXXX, XXXXXXX, XXXXXXX, \
XXXXXXX, KC_DEL, KC_INS, KC_LEFT, KC_DOWN, KC_RGHT, KC_LEFT, KC_DOWN, KC_RGHT, KC_INS, KC_DEL, XXXXXXX, \
XXXXXXX, XXXXXXX, XXXXXXX, KC_END, XXXXXXX, KC_PGDN,MO(_ADJUST),
MO(_ADJUST), KC_PGDN, XXXXXXX, KC_END, XXXXXXX, XXXXXXX, XXXXXXX, \
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX \
[_PADFUNC] = LAYOUT_kc( \
XXXX, XXXX, XXXX, PAUS, SLCK, PSCR, PSCR, SLCK, PAUS, XXXX, XXXX, XXXX, \
XXXX, XXXX, XXXX, HOME, UP, PGUP, PGUP, UP, HOME, XXXX, XXXX, XXXX, \
XXXX, DEL, INS, LEFT, DOWN, RGHT, LEFT, DOWN, RGHT, INS, DEL, XXXX, \
XXXX, XXXX, XXXX, END, XXXX, PGDN, ADJ, ADJ, PGDN, XXXX, END, XXXX, XXXX, XXXX, \
XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, ____, ____, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX \
),
/* Lower
@ -233,13 +230,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | PrtSc| | | | | | | | | PrtSc| | |
* `-------------------------------------------------------------------------------------------------'
*/
[_LOWER] = LAYOUT( \
XXXXXXX, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, \
XXXXXXX, XXXXXXX, KC_PAUS, KC_SLCK, KC_INS, XXXXXXX, XXXXXXX, KC_INS, KC_SLCK, KC_PAUS, XXXXXXX, KC_F12, \
_______, KC_HOME, XXXXXXX, KC_UP, KC_DEL, KC_PGUP, KC_PGUP, KC_DEL, KC_UP, XXXXXXX, KC_HOME, _______, \
_______, KC_END, KC_LEFT, KC_DOWN, KC_RGHT, KC_PGDN, XXXXXXX, XXXXXXX,KC_PGDN, KC_LEFT, KC_DOWN, KC_RGHT, KC_END, _______, \
_______, _______, KC_PSCR, _______, _______, _______, MO(_ADJUST),
MO(_ADJUST), _______, _______, _______, KC_PSCR, _______, _______ \
[_LOWER] = LAYOUT_kc( \
XXXX, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, \
XXXX, XXXX, PAUS, SLCK, INS, XXXX, XXXX, INS, SLCK, PAUS, XXXX, F12, \
____, HOME, XXXX, UP, DEL, PGUP, PGUP, DEL, UP, XXXX, HOME, ____, \
____, END, LEFT, DOWN, RGHT, PGDN, XXXX, XXXX, PGDN, LEFT, DOWN, RGHT, END, ____, \
____, ____, PSCR, ____, ____, ____, ADJ, ADJ, ____, ____, ____, PSCR, ____, ____ \
),
/* Raise
@ -255,13 +251,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | | | | | | | | |
* `-------------------------------------------------------------------------------------------------'
*/
[_RAISE] = LAYOUT( \
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, LSFT(KC_MINS), KC_MINS, KC_EQL, LSFT(KC_EQL), XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, \
_______, XXXXXXX, XXXXXXX, XXXXXXX, LSFT(KC_LBRC), KC_LBRC, KC_RBRC, LSFT(KC_RBRC), XXXXXXX, XXXXXXX, XXXXXXX, _______, \
_______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, EISU, EISU, KANA, KANA, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY, _______, \
MO(_ADJUST),MO(_ADJUST),XXXXXXX, _______, _______, XXXXXXX, _______,
_______, XXXXXXX, _______, _______, XXXXXXX,MO(_ADJUST),MO(_ADJUST) \
[_RAISE] = LAYOUT_kc( \
XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, XXXX, \
XXXX, XXXX, XXXX, XXXX, LSMI, MINS, EQL, LSEQ, XXXX, XXXX, XXXX, XXXX, \
____, XXXX, XXXX, XXXX, LSLB, LBRC, RBRC, LSRB, XXXX, XXXX, XXXX, ____, \
____, XXXX, XXXX, XXXX, XXXX,xEISU,xEISU, xKANA,xKANA,MNXT, VOLD, VOLU, MPLY, ____, \
ADJ, ADJ, XXXX, ____, ____, XXXX, ____, ____, XXXX, ____, ____, XXXX, ADJ, ADJ \
),
/* Adjust (Lower + Raise)
@ -278,11 +273,11 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* `-------------------------------------------------------------------------------------------------'
*/
[_ADJUST] = LAYOUT( \
XXXXXXX, KEYPAD, DVORAK, COLEMAK, EUCALYN, QWERTY, QWERTY, EUCALYN, COLEMAK, DVORAK, KEYPAD, XXXXXXX, \
XXXXXXX, RESET, RGBRST, RGB_TOG, AU_ON, AG_SWAP, AG_SWAP, AU_ON, RGB_TOG, RGBRST, XXXXXXX, XXXXXXX, \
RGB_HUI, RGB_SAI, RGB_VAI, RGB_MOD, AU_OFF, AG_NORM, AG_NORM, AU_OFF, RGB_MOD, RGB_VAI, RGB_SAI, RGB_HUI, \
RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, RGB_VAD, RGB_SAD, RGB_HUD, \
_______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______ \
XXXXXXX, KEYPAD, DVORAK, COLEMAK, EUCALYN, QWERTY, QWERTY, EUCALYN, COLEMAK, DVORAK, KEYPAD, XXXXXXX, \
XXXXXXX, RESET, RGBRST, RGB_TOG, AU_ON, AG_SWAP, AG_SWAP, AU_ON, RGB_TOG, RGBRST, XXXXXXX, XXXXXXX, \
RGB_HUI, RGB_SAI, RGB_VAI, RGB_MOD, AU_OFF, AG_NORM, AG_NORM, AU_OFF, RGB_MOD, RGB_VAI, RGB_SAI, RGB_HUI, \
RGB_HUD, RGB_SAD, RGB_VAD, XXXXXXX, XXXXXXX, XXXXXXX, ___,___, XXXXXXX, XXXXXXX, XXXXXXX, RGB_VAD, RGB_SAD, RGB_HUD, \
_______, _______, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, ___,___, XXXXXXX, XXXXXXX, XXXXXXX, XXXXXXX, _______, _______ \
),
/* AUX modifier key layer
@ -298,13 +293,12 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | BS | Enter| | | | | | | |
* `-------------------------------------------------------------------------------------------------'
*/
[_AUX] = LAYOUT( \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, \
_______, _______, _______, _______, _______, KC_BSPC, LT(_RAISE,KC_ENT), \
_______, _______, _______, _______, _______, _______, _______ \
[_AUX] = LAYOUT_kc( \
____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \
____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \
____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \
____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, ____, \
____, ____, ____, ____, ____, BSPC, RAEN, ____, ____, ____, ____, ____, ____, ____ \
)
};
@ -400,13 +394,13 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
}
return false;
break;
case ZERO2:
case KC_ZERO2:
if (record->event.pressed) {
SEND_STRING("00");
}
return false;
break;
case EISU:
case KC_xEISU:
if (record->event.pressed) {
if(keymap_config.swap_lalt_lgui==false){
register_code(KC_LANG2);
@ -418,7 +412,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
}
return false;
break;
case KANA:
case KC_xKANA:
if (record->event.pressed) {
if(keymap_config.swap_lalt_lgui==false){
register_code(KC_LANG1);

Loading…
Cancel
Save