diff options
author | Eric <22215921+ericywl@users.noreply.github.com> | 2018-04-30 23:22:02 +0800 |
---|---|---|
committer | Drashna Jaelre <drashna@live.com> | 2018-04-30 08:22:02 -0700 |
commit | 187d76476ec8bbf066b367956dc3d4f9fdba69a9 (patch) | |
tree | 85f57f9e86a62680d136e5a1151310dae3b78524 /keyboards | |
parent | 43e589aa02379ec932ce530fa7c3e7e918eae7cb (diff) |
QMK Configurator Support for JD45 and JD40 (#2851)
* Added JD45 Config
* Added JD40 Config
* Changed KEYMAP to LAYOUT for JD40 and JD45
Diffstat (limited to 'keyboards')
-rw-r--r-- | keyboards/jd40/info.json | 57 | ||||
-rw-r--r-- | keyboards/jd40/jd40.h | 2 | ||||
-rw-r--r-- | keyboards/jd40/keymaps/default/keymap.c | 205 | ||||
-rw-r--r-- | keyboards/jd40/keymaps/vanagon/config.h | 2 | ||||
-rw-r--r-- | keyboards/jd40/keymaps/vanagon/keymap.c | 45 | ||||
-rw-r--r-- | keyboards/jd45/info.json | 60 | ||||
-rw-r--r-- | keyboards/jd45/jd45.h | 2 | ||||
-rw-r--r-- | keyboards/jd45/keymaps/blakedietz/config.h | 2 | ||||
-rw-r--r-- | keyboards/jd45/keymaps/blakedietz/keymap.c | 409 | ||||
-rw-r--r-- | keyboards/jd45/keymaps/default/keymap.c | 12 | ||||
-rw-r--r-- | keyboards/jd45/keymaps/jeebak/config.h | 2 | ||||
-rw-r--r-- | keyboards/jd45/keymaps/jeebak/keymap.c | 539 | ||||
-rw-r--r-- | keyboards/jd45/keymaps/justin/keymap.c | 94 | ||||
-rw-r--r-- | keyboards/jd45/keymaps/mjt/keymap.c | 105 | ||||
-rw-r--r-- | keyboards/jd45/keymaps/mjt6u/keymap.c | 198 |
15 files changed, 956 insertions, 778 deletions
diff --git a/keyboards/jd40/info.json b/keyboards/jd40/info.json new file mode 100644 index 0000000000..4d321ee356 --- /dev/null +++ b/keyboards/jd40/info.json @@ -0,0 +1,57 @@ +{ + "keyboard_name": "jd40", + "url": "", + "maintainer": "qmk", + "width": 12, + "height": 4, + "layouts": { + "LAYOUT": { + "layout": [ + { "label": "Esc", "x": 0, "y": 0 }, + { "label": "Q", "x": 1, "y": 0 }, + { "label": "W", "x": 2, "y": 0 }, + { "label": "E", "x": 3, "y": 0 }, + { "label": "R", "x": 4, "y": 0 }, + { "label": "T", "x": 5, "y": 0 }, + { "label": "Y", "x": 6, "y": 0 }, + { "label": "U", "x": 7, "y": 0 }, + { "label": "I", "x": 8, "y": 0 }, + { "label": "O", "x": 9, "y": 0 }, + { "label": "P", "x": 10, "y": 0 }, + { "label": "Back<br>Space", "x": 11, "y": 0 }, + { "label": "Tab", "x": 0, "y": 1, "w": 1.25 }, + { "label": "A", "x": 1.25, "y": 1 }, + { "label": "S", "x": 2.25, "y": 1 }, + { "label": "D", "x": 3.25, "y": 1 }, + { "label": "F", "x": 4.25, "y": 1 }, + { "label": "G", "x": 5.25, "y": 1 }, + { "label": "H", "x": 6.25, "y": 1 }, + { "label": "J", "x": 7.25, "y": 1 }, + { "label": "K", "x": 8.25, "y": 1 }, + { "label": "L", "x": 9.25, "y": 1 }, + { "label": "Enter", "x": 10.25, "y": 1, "w": 1.75 }, + { "label": "Shift", "x": 0, "y": 2, "w": 1.75 }, + { "label": "Z", "x": 1.75, "y": 2 }, + { "label": "X", "x": 2.75, "y": 2 }, + { "label": "C", "x": 3.75, "y": 2 }, + { "label": "V", "x": 4.75, "y": 2 }, + { "label": "B", "x": 5.75, "y": 2 }, + { "label": "N", "x": 6.75, "y": 2 }, + { "label": "M", "x": 7.75, "y": 2 }, + { "label": "<", "x": 8.75, "y": 2 }, + { "label": "Shift", "x": 9.75, "y": 2, "w": 1.25 }, + { "label": ">", "x": 11, "y": 2 }, + { "label": "Ctrl", "x": 0, "y": 3 }, + { "label": "Fn", "x": 1, "y": 3 }, + { "label": "Alt", "x": 2, "y": 3 }, + { "label": "Super", "x": 3, "y": 3, "w": 1.25 }, + { "x": 4.25, "y": 3, "w": 1.75 }, + { "x": 6, "y": 3, "w": 1.75 }, + { "label": "Menu", "x": 7.75, "y": 3, "w": 1.25 }, + { "label": "Alt", "x": 9, "y": 3 }, + { "label": "Fn2", "x": 10, "y": 3 }, + { "label": "Ctrl", "x": 11, "y": 3 } + ] + } + } +} diff --git a/keyboards/jd40/jd40.h b/keyboards/jd40/jd40.h index 77a1222993..0000bc7ed9 100644 --- a/keyboards/jd40/jd40.h +++ b/keyboards/jd40/jd40.h @@ -30,7 +30,7 @@ inline void gh60_wasd_leds_off(void) { DDRF &= ~(1<<7); PORTF &= ~(1<<7); } /* JD40 MKII keymap definition macro */ -#define KEYMAP( \ +#define LAYOUT( \ K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, \ K13, K14, K15, K16, K17, K18, K19, K20, K21, K22, K23, \ K24, K25, K26, K27, K28, K29, K30, K31, K32, K33, K34, \ diff --git a/keyboards/jd40/keymaps/default/keymap.c b/keyboards/jd40/keymaps/default/keymap.c index 79ac146c9e..b8cff95ac4 100644 --- a/keyboards/jd40/keymaps/default/keymap.c +++ b/keyboards/jd40/keymaps/default/keymap.c @@ -1,4 +1,4 @@ -#include "jd40.h" +#include QMK_KEYBOARD_H #include "action_layer.h" #define _BL 0 @@ -7,32 +7,33 @@ #define _UL 3 const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_BL] = KEYMAP( - F12, Q, W, E, R, T, Y, U, I, O, P, BSPC, - TAB, A, S, D, F, G, H, J, K, L, ENT, - LSFT, Z, X, C, V, B, N, M, COMM, UP, DOT, - LCTL, LGUI, LALT, FN0, SPC, SPC, FN0, LEFT, DOWN, RIGHT ), - - [_AL] = KEYMAP( - GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, DEL, - CAPS, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, SCLN, PGUP, QUOT, - TRNS, TRNS, TRNS, TRNS, FN3, FN3, TRNS, HOME, PGDN, END ), + [_BL] = LAYOUT( + F12, Q, W, E, R, T, Y, U, I, O, P, BSPC, + TAB, A, S, D, F, G, H, J, K, L, ENT, + LSFT, Z, X, C, V, B, N, M, COMM, UP, DOT, + LCTL, LGUI, LALT, FN0, SPC, SPC, FN0, LEFT, DOWN, RIGHT), - [_FL] = KEYMAP( - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS ), - - [_UL] = KEYMAP( - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - TRNS, FN4, FN5, FN11, FN10, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS ), + [_AL] = LAYOUT( + GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, DEL, + CAPS, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, SCLN, PGUP, QUOT, + TRNS, TRNS, TRNS, TRNS, FN3, FN3, TRNS, HOME, PGDN, END), + + [_FL] = LAYOUT( + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), + + [_UL] = LAYOUT( + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + TRNS, FN4, FN5, FN11, FN10, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), }; -enum function_id { +enum function_id +{ RGBLED_TOGGLE, RGBLED_STEP_MODE, RGBLED_INCREASE_HUE, @@ -41,20 +42,20 @@ enum function_id { RGBLED_DECREASE_SAT, RGBLED_INCREASE_VAL, RGBLED_DECREASE_VAL, - SHIFT_ESC, + SHIFT_ESC, }; const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_MOMENTARY(1), // Momentary Fn overlay - [1] = ACTION_LAYER_TOGGLE(2), // Toggle Arrow Layer overlay - [2] = ACTION_LAYER_TAP_KEY(2, KC_CAPS), // Tap to toggle caps lock and hold to activate function layer - [3] = ACTION_LAYER_TOGGLE(3), // Toggle Underglow Layer overlay - [4] = ACTION_FUNCTION(RGBLED_TOGGLE), //Turn on/off underglow - [5] = ACTION_FUNCTION(RGBLED_STEP_MODE), // Change underglow mode - [6] = ACTION_FUNCTION(RGBLED_INCREASE_HUE), - [7] = ACTION_FUNCTION(RGBLED_DECREASE_HUE), - [8] = ACTION_FUNCTION(RGBLED_INCREASE_SAT), - [9] = ACTION_FUNCTION(RGBLED_DECREASE_SAT), + [0] = ACTION_LAYER_MOMENTARY(1), // Momentary Fn overlay + [1] = ACTION_LAYER_TOGGLE(2), // Toggle Arrow Layer overlay + [2] = ACTION_LAYER_TAP_KEY(2, KC_CAPS), // Tap to toggle caps lock and hold to activate function layer + [3] = ACTION_LAYER_TOGGLE(3), // Toggle Underglow Layer overlay + [4] = ACTION_FUNCTION(RGBLED_TOGGLE), //Turn on/off underglow + [5] = ACTION_FUNCTION(RGBLED_STEP_MODE), // Change underglow mode + [6] = ACTION_FUNCTION(RGBLED_INCREASE_HUE), + [7] = ACTION_FUNCTION(RGBLED_DECREASE_HUE), + [8] = ACTION_FUNCTION(RGBLED_INCREASE_SAT), + [9] = ACTION_FUNCTION(RGBLED_DECREASE_SAT), [10] = ACTION_FUNCTION(RGBLED_INCREASE_VAL), [11] = ACTION_FUNCTION(RGBLED_DECREASE_VAL), [12] = ACTION_FUNCTION(SHIFT_ESC), @@ -62,103 +63,133 @@ const uint16_t PROGMEM fn_actions[] = { const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - // MACRODOWN only works in this function - switch(id) { - case 0: - if (record->event.pressed) { + // MACRODOWN only works in this function + switch (id) + { + case 0: + if (record->event.pressed) + { register_code(KC_RSFT); - } else { + } + else + { unregister_code(KC_RSFT); - } + } break; - } + } return MACRO_NONE; }; -void matrix_scan_user(void) { +void matrix_scan_user(void) +{ -// Layer LED indicators -// ESC led on when in function layer, WASD cluster leds enabled when on arrow cluster + // Layer LED indicators + // ESC led on when in function layer, WASD cluster leds enabled when on arrow cluster uint32_t layer = layer_state; - if (layer & (1<<1)) { + if (layer & (1 << 1)) + { //gh60_wasd_leds_on(); - } else { + } + else + { //gh60_wasd_leds_off(); } - if (layer & (1<<2)) { + if (layer & (1 << 2)) + { //gh60_esc_led_on(); - } else { + } + else + { //gh60_esc_led_off(); } }; -#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT)|MOD_BIT(KC_RSHIFT)) +#define MODS_CTRL_MASK (MOD_BIT(KC_LSHIFT) | MOD_BIT(KC_RSHIFT)) -void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) { - switch (id) { +void action_function(keyrecord_t *record, uint8_t id, uint8_t opt) +{ + switch (id) + { case RGBLED_TOGGLE: - //led operations - if (record->event.pressed) { - rgblight_toggle(); + //led operations + if (record->event.pressed) + { + rgblight_toggle(); } break; case RGBLED_INCREASE_HUE: - if (record->event.pressed) { - rgblight_increase_hue(); + if (record->event.pressed) + { + rgblight_increase_hue(); } break; case RGBLED_DECREASE_HUE: - if (record->event.pressed) { - rgblight_decrease_hue(); + if (record->event.pressed) + { + rgblight_decrease_hue(); } break; case RGBLED_INCREASE_SAT: - if (record->event.pressed) { - rgblight_increase_sat(); + if (record->event.pressed) + { + rgblight_increase_sat(); } break; case RGBLED_DECREASE_SAT: - if (record->event.pressed) { - rgblight_decrease_sat(); + if (record->event.pressed) + { + rgblight_decrease_sat(); } break; case RGBLED_INCREASE_VAL: - if (record->event.pressed) { - rgblight_increase_val(); + if (record->event.pressed) + { + rgblight_increase_val(); } break; case RGBLED_DECREASE_VAL: - if (record->event.pressed) { - rgblight_decrease_val(); + if (record->event.pressed) + { + rgblight_decrease_val(); } break; case RGBLED_STEP_MODE: - if (record->event.pressed) { - rgblight_step(); + if (record->event.pressed) + { + rgblight_step(); } break; - static uint8_t shift_esc_shift_mask; + static uint8_t shift_esc_shift_mask; // Shift + ESC = ~ case SHIFT_ESC: - shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; - if (record->event.pressed) { - if (shift_esc_shift_mask) { - add_key(KC_GRV); - send_keyboard_report(); - } else { - add_key(KC_ESC); - send_keyboard_report(); + shift_esc_shift_mask = get_mods() & MODS_CTRL_MASK; + if (record->event.pressed) + { + if (shift_esc_shift_mask) + { + add_key(KC_GRV); + send_keyboard_report(); + } + else + { + add_key(KC_ESC); + send_keyboard_report(); + } } - } else { - if (shift_esc_shift_mask) { - del_key(KC_GRV); - send_keyboard_report(); - } else { - del_key(KC_ESC); - send_keyboard_report(); + else + { + if (shift_esc_shift_mask) + { + del_key(KC_GRV); + send_keyboard_report(); + } + else + { + del_key(KC_ESC); + send_keyboard_report(); + } } - } - break; + break; } }; diff --git a/keyboards/jd40/keymaps/vanagon/config.h b/keyboards/jd40/keymaps/vanagon/config.h index 65d2fe6f98..ed09b50ee4 100644 --- a/keyboards/jd40/keymaps/vanagon/config.h +++ b/keyboards/jd40/keymaps/vanagon/config.h @@ -1,6 +1,6 @@ #include "../../config.h" -#define KEYMAP_VANAGON(\ +#define LAYOUT_VANAGON(\ K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, \ K13, K14, K15, K16, K17, K18, K19, K20, K21, K22, K23, \ K24, K25, K26, K27, K28, K29, K30, K31, K32, K33, K34, \ diff --git a/keyboards/jd40/keymaps/vanagon/keymap.c b/keyboards/jd40/keymaps/vanagon/keymap.c index 34314614c6..e16a44af33 100644 --- a/keyboards/jd40/keymaps/vanagon/keymap.c +++ b/keyboards/jd40/keymaps/vanagon/keymap.c @@ -1,29 +1,26 @@ -#include "jd40.h" +#include QMK_KEYBOARD_H #include "action_layer.h" -enum { - _BL = 0, - _AL1, - _AL2, +enum +{ + _BL = 0, + _AL1, + _AL2, }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_BL] = KEYMAP_VANAGON( - KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, - MO(_AL1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, MO(_AL1), - KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, - MO(_AL2), KC_LCTL, KC_LALT, KC_LGUI, KC_ENT, KC_SPC, KC_RGUI, KC_RALT, KC_RSPC, MO(_AL2) - ), - [_AL1] = KEYMAP_VANAGON( - KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LBRC, KC_RBRC, KC_TRNS, - KC_TRNS, KC_BSLS, KC_QUOT, KC_MINS, KC_EQL, KC_COLN, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT, KC_TRNS, - KC_TRNS, KC_ESC, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS - ), - [_AL2] = KEYMAP_VANAGON( - KC_TILD, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, - KC_TRNS, KC_PIPE, KC_DQT, KC_UNDS, KC_PLUS, KC_SCLN, KC_TRNS, KC_4, KC_5, KC_6, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_0, KC_1, KC_2, KC_3, KC_TRNS, - KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS - ) -}; + [_BL] = LAYOUT_VANAGON( + KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, + MO(_AL1), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, MO(_AL1), + KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, + MO(_AL2), KC_LCTL, KC_LALT, KC_LGUI, KC_ENT, KC_SPC, KC_RGUI, KC_RALT, KC_RSPC, MO(_AL2)), + [_AL1] = LAYOUT_VANAGON( + KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LBRC, KC_RBRC, KC_TRNS, + KC_TRNS, KC_BSLS, KC_QUOT, KC_MINS, KC_EQL, KC_COLN, KC_LEFT, KC_UP, KC_DOWN, KC_RGHT, KC_TRNS, + KC_TRNS, KC_ESC, KC_VOLD, KC_VOLU, KC_MUTE, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS), + [_AL2] = LAYOUT_VANAGON( + KC_TILD, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_TRNS, + KC_TRNS, KC_PIPE, KC_DQT, KC_UNDS, KC_PLUS, KC_SCLN, KC_TRNS, KC_4, KC_5, KC_6, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_0, KC_1, KC_2, KC_3, KC_TRNS, + KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS)}; diff --git a/keyboards/jd45/info.json b/keyboards/jd45/info.json new file mode 100644 index 0000000000..77ad23a4be --- /dev/null +++ b/keyboards/jd45/info.json @@ -0,0 +1,60 @@ +{ + "keyboard_name": "jd45", + "url": "", + "maintainer": "qmk", + "width": 13, + "height": 4, + "layouts": { + "LAYOUT": { + "layout": [ + { "label": "Tab", "x": 0, "y": 0 }, + { "label": "Q", "x": 1, "y": 0 }, + { "label": "W", "x": 2, "y": 0 }, + { "label": "E", "x": 3, "y": 0 }, + { "label": "R", "x": 4, "y": 0 }, + { "label": "T", "x": 5, "y": 0 }, + { "label": "Y", "x": 6, "y": 0 }, + { "label": "U", "x": 7, "y": 0 }, + { "label": "I", "x": 8, "y": 0 }, + { "label": "O", "x": 9, "y": 0 }, + { "label": "P", "x": 10, "y": 0 }, + { "label": "Back<br>Space", "x": 11, "y": 0 }, + { "x": 12, "y": 0 }, + { "label": "Caps", "x": 0, "y": 1, "w": 1.25 }, + { "label": "A", "x": 1.25, "y": 1 }, + { "label": "S", "x": 2.25, "y": 1 }, + { "label": "D", "x": 3.25, "y": 1 }, + { "label": "F", "x": 4.25, "y": 1 }, + { "label": "G", "x": 5.25, "y": 1 }, + { "label": "H", "x": 6.25, "y": 1 }, + { "label": "J", "x": 7.25, "y": 1 }, + { "label": "K", "x": 8.25, "y": 1 }, + { "label": "L", "x": 9.25, "y": 1 }, + { "label": ":", "x": 10.25, "y": 1 }, + { "label": "Enter", "x": 11.25, "y": 1, "w": 1.75 }, + { "label": "Shift", "x": 0, "y": 2, "w": 1.75 }, + { "label": "Z", "x": 1.75, "y": 2 }, + { "label": "X", "x": 2.75, "y": 2 }, + { "label": "C", "x": 3.75, "y": 2 }, + { "label": "V", "x": 4.75, "y": 2 }, + { "label": "B", "x": 5.75, "y": 2 }, + { "label": "N", "x": 6.75, "y": 2 }, + { "label": "M", "x": 7.75, "y": 2 }, + { "label": "<", "x": 8.75, "y": 2 }, + { "label": ">", "x": 9.75, "y": 2 }, + { "label": "?", "x": 10.75, "y": 2 }, + { "label": "Shift", "x": 11.75, "y": 2, "w": 1.25 }, + { "label": "Hyper", "x": 0, "y": 3, "w": 1.25 }, + { "label": "Super", "x": 1.25, "y": 3 }, + { "label": "Meta", "x": 2.25, "y": 3, "w": 1.25 }, + { "label": "Alt", "x": 3.5, "y": 3, "w": 1.25 }, + { "x": 4.75, "y": 3, "w": 1.75 }, + { "x": 6.5, "y": 3, "w": 1.75 }, + { "label": "Meta", "x": 8.25, "y": 3, "w": 1.25 }, + { "label": "Super", "x": 9.5, "y": 3, "w": 1.25 }, + { "label": "Fn2", "x": 10.75, "y": 3 }, + { "label": "Ctrl", "x": 11.75, "y": 3, "w": 1.25 } + ] + } + } +} diff --git a/keyboards/jd45/jd45.h b/keyboards/jd45/jd45.h index 04ac6649e7..48641c199a 100644 --- a/keyboards/jd45/jd45.h +++ b/keyboards/jd45/jd45.h @@ -5,7 +5,7 @@ /* JD45 keymap definition macro */ -#define KEYMAP( \ +#define LAYOUT( \ K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, K13, \ K14, K15, K16, K17, K18, K19, K20, K21, K22, K23, K24, K25, \ K26, K27, K28, K29, K30, K31, K32, K33, K34, K35, K36, K37, \ diff --git a/keyboards/jd45/keymaps/blakedietz/config.h b/keyboards/jd45/keymaps/blakedietz/config.h index 6667d6fa1d..38d850ef6e 100644 --- a/keyboards/jd45/keymaps/blakedietz/config.h +++ b/keyboards/jd45/keymaps/blakedietz/config.h @@ -3,7 +3,7 @@ /** *JD45 keymap definition macro */ -#define KEYMAP_JD45( \ +#define LAYOUT_JD45( \ K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, K13, \ K14, K15, K16, K17, K18, K19, K20, K21, K22, K23, K24, K25, \ K26, K27, K28, K29, K30, K31, K32, K33, K34, K35, K36, K37, \ diff --git a/keyboards/jd45/keymaps/blakedietz/keymap.c b/keyboards/jd45/keymaps/blakedietz/keymap.c index 1b1d0817e6..bde760a223 100644 --- a/keyboards/jd45/keymaps/blakedietz/keymap.c +++ b/keyboards/jd45/keymaps/blakedietz/keymap.c @@ -1,4 +1,4 @@ -#include "jd45.h" +#include QMK_KEYBOARD_H extern keymap_config_t keymap_config; @@ -19,28 +19,30 @@ extern keymap_config_t keymap_config; // TODO: (bdietz) - make a symbol layer for greek symbols // Keycodes -enum planck_keycodes { - QWERTY = SAFE_RANGE, - LOWER, - RAISE, +enum planck_keycodes +{ + QWERTY = SAFE_RANGE, + LOWER, + RAISE, }; -enum macro_keycodes { - KC_ALT_TAB, - KC_CMD_TAB, - KC_CTL_TAB, - KC_CMD_SLSH, - KC_AG_FIND, - KC_AG_AGAIN, - KC_AG_UNDO, - KC_AG_CUT, - KC_AG_COPY, - KC_AG_PASTE, - KC_AG_DESK_L, - KC_AG_DESK_R, - KC_AG_TAB_C, - KC_AG_TAB_N, - KC_AG_TAB_R, +enum macro_keycodes +{ + KC_ALT_TAB, + KC_CMD_TAB, + KC_CTL_TAB, + KC_CMD_SLSH, + KC_AG_FIND, + KC_AG_AGAIN, + KC_AG_UNDO, + KC_AG_CUT, + KC_AG_COPY, + KC_AG_PASTE, + KC_AG_DESK_L, + KC_AG_DESK_R, + KC_AG_TAB_C, + KC_AG_TAB_N, + KC_AG_TAB_R, }; // Fillers to make layering more clear @@ -55,36 +57,36 @@ enum macro_keycodes { * - will fire z if tapped * - will fire cmd/super/win if held */ -#define ALT_DOT ALT_T(KC_DOT) -#define ALT_X ALT_T(KC_X) -#define CTL_SLSH CTL_T(KC_SLSH) -#define CTL_Z CTL_T(KC_Z) -#define GUI_C GUI_T(KC_C) -#define GUI_COMM GUI_T(KC_COMM) -#define HPR_ESC ALL_T(KC_ESC) -#define HPR_QUO ALL_T(KC_QUOT) +#define ALT_DOT ALT_T(KC_DOT) +#define ALT_X ALT_T(KC_X) +#define CTL_SLSH CTL_T(KC_SLSH) +#define CTL_Z CTL_T(KC_Z) +#define GUI_C GUI_T(KC_C) +#define GUI_COMM GUI_T(KC_COMM) +#define HPR_ESC ALL_T(KC_ESC) +#define HPR_QUO ALL_T(KC_QUOT) // Toggle to VIM when left space button is held, emit space keycode when left space is tapped -#define TGL_VIM LT(_VIM, KC_SPC) +#define TGL_VIM LT(_VIM, KC_SPC) // Toggle to the mouse layer when the right space button is held and emit enter when right space is tapped -#define TGL_MOUSE LT(_MOUSECURSOR, KC_ENT) +#define TGL_MOUSE LT(_MOUSECURSOR, KC_ENT) // TODO: (bdietz) - need to audit these keycodes to see what sort of cool things the default layout was doing. -#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 -#define CMD_SLSH M(KC_CMD_SLSH) // Macro for Cmd-Slash (personal shortcut to toggle iTerm2 visibility) -#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) -#define AG_D_L M(KC_AG_DESK_L) // For Virtual Desktop Switching: Left, and -#define AG_D_R M(KC_AG_DESK_R) // Right -#define AG_T_C M(KC_AG_TAB_C) // For Chrome, etc. Tab Close, -#define AG_T_N M(KC_AG_TAB_N) // Tab New, and -#define AG_T_R M(KC_AG_TAB_R) // Tab Reopen Closed +#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 +#define CMD_SLSH M(KC_CMD_SLSH) // Macro for Cmd-Slash (personal shortcut to toggle iTerm2 visibility) +#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) +#define AG_D_L M(KC_AG_DESK_L) // For Virtual Desktop Switching: Left, and +#define AG_D_R M(KC_AG_DESK_R) // Right +#define AG_T_C M(KC_AG_TAB_C) // For Chrome, etc. Tab Close, +#define AG_T_N M(KC_AG_TAB_N) // Tab New, and +#define AG_T_R M(KC_AG_TAB_R) // Tab Reopen Closed /* Qwerty * @@ -99,19 +101,19 @@ enum macro_keycodes { * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' */ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[_QWERTY] = KEYMAP_JD45( -/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ - KC_TAB, 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_NO), -/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ - HPR_ESC , KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, LT(_MEDIA, KC_SCLN), HPR_QUO, -/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ - KC_LSFT, CTL_Z, ALT_X, GUI_C, KC_V, KC_B, KC_N, KC_M,GUI_COMM, ALT_DOT, CTL_SLSH, KC_RSFT , -/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ - _______ , _______ , _______ , LOWER , TGL_VIM , TGL_MOUSE , RAISE , _______ , _______ , _______), -/*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ + [_QWERTY] = LAYOUT_JD45( + /*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ + KC_TAB, 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_NO), + /*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ + HPR_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, LT(_MEDIA, KC_SCLN), HPR_QUO, + /*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ + KC_LSFT, CTL_Z, ALT_X, GUI_C, KC_V, KC_B, KC_N, KC_M, GUI_COMM, ALT_DOT, CTL_SLSH, KC_RSFT, + /*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ + _______, _______, _______, LOWER, TGL_VIM, TGL_MOUSE, RAISE, _______, _______, _______), + /*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ -// TODO: (bdietz) - update the keymap documentation to include the modifier keys on the third row -/* Lower + // TODO: (bdietz) - update the keymap documentation to include the modifier keys on the third row + /* Lower * ,---------+------+------+------+------+------+------+------+------+------+------+------+------. * | ` | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | Bksp | * |---------`------`------`------`------`------`------`------`------`------`------`------`------| @@ -122,18 +124,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | Prev | Next | Mute | * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' */ -[_LOWER] = KEYMAP_JD45( -/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ - KC_GRV,KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, KC_BSPC, -/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ - 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 , CTL_T(KC_F7), ALT_T(KC_F8),GUI_T(KC_F9), KC_F10, KC_F11, KC_F12, KC_MINS, GUI_T(KC_EQL) , ALT_T(KC_LBRC), CTL_T(KC_RBRC), KC_BSLS , -/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ - _______ , _______, _______, _______, _______ , _______ , _______, KC_MPRV, KC_MNXT, KC_MUTE), -/*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ + [_LOWER] = LAYOUT_JD45( + /*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ + KC_GRV, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC, KC_BSPC, + /*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ + 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, CTL_T(KC_F7), ALT_T(KC_F8), GUI_T(KC_F9), KC_F10, KC_F11, KC_F12, KC_MINS, GUI_T(KC_EQL), ALT_T(KC_LBRC), CTL_T(KC_RBRC), KC_BSLS, + /*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ + _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_MUTE), + /*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ -/* Raise + /* Raise * ,---------+------+------+------+------+------+------+------+------+------+------+------+------. * | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | Bksp | * |---------`------`------`------`------`------`------`------`------`------`------`------`------| @@ -144,18 +146,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | Prev | Next | Mute | * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' */ -[_RAISE] = KEYMAP_JD45( -/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ - KC_TILD, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, KC_BSPC, -/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ - 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 , CTL_T(KC_7), ALT_T(KC_8), GUI_T(KC_9), KC_0, KC_MINS, KC_DOT, KC_1 ,GUI_T(KC_2), ALT_T(KC_3), CTL_T(KC_SLSH), KC_BSLS , -/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ - _______ , _______, _______, _______, _______ , _______ , _______, KC_MPRV, KC_MNXT, KC_MUTE), -/*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ + [_RAISE] = LAYOUT_JD45( + /*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ + KC_TILD, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, KC_BSPC, + /*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ + 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, CTL_T(KC_7), ALT_T(KC_8), GUI_T(KC_9), KC_0, KC_MINS, KC_DOT, KC_1, GUI_T(KC_2), ALT_T(KC_3), CTL_T(KC_SLSH), KC_BSLS, + /*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ + _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_MUTE), + /*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ -/* Mouse Layer + /* Mouse Layer * ,---------+------+------+------+------+------+------+------+------+------+------+------+------. * | | |ACCL0 | | | | |WHL_L | Up |WHL_R | BTN2 | | | * |---------`------`------`------`------`------`------`------`------`------`------`------`------| @@ -167,18 +169,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' */ -[_MOUSECURSOR] = KEYMAP_JD45( -/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ - _______,_______, _______, KC_MS_U, _______, _______, _______, KC_ACL2, KC_ACL1, KC_ACL0, _______, _______, _______, -/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ - _______ ,_______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, KC_BTN1, KC_BTN2, _______, _______, _______ , -/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ - _______ ,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ , -/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ - _______ , _______, _______, _______, _______, _______, _______, _______, _______, _______), -/*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ + [_MOUSECURSOR] = LAYOUT_JD45( + /*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ + _______, _______, _______, KC_MS_U, _______, _______, _______, KC_ACL2, KC_ACL1, KC_ACL0, _______, _______, _______, + /*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ + _______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, KC_BTN1, KC_BTN2, _______, _______, _______, + /*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + /*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + /*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ -/* Adjust (Lower + Raise) + /* Adjust (Lower + Raise) * ,---------+------+------+------+------+------+------+------+------+------+------+------+------. * | | | | | | | | | | | | | Del | * |---------`------`------`------`------`------`------`------`------`------`------`------`------| @@ -189,19 +191,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | Reset | * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' */ -[_ADJUST] = KEYMAP_JD45( + [_ADJUST] = LAYOUT_JD45( -/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ - _______,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL , -/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ - _______ ,_______, _______, _______, _______, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______ , -/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ - _______ ,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ , -/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ - _______ , _______, _______, _______, _______ , _______ , _______, _______, _______, RESET), -/*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ + /*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, + /*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ + _______, _______, _______, _______, _______, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______, + /*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + /*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ + _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET), + /*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ -/* VIM + /* VIM * ,---------+------+------+------+------+------+------+------+------+------+------+------+------. * | | | | | | | | | | | | | | * |---------`------`------`------`------`------`------`------`------`------`------`------`------| @@ -212,18 +214,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' */ -[_VIM] = KEYMAP_JD45( -/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ - _______,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, -/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ - _______ ,_______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, _______ , -/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ - _______ ,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ , -/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ - _______ , _______, _______, _______, _______ , _______ , _______, _______, _______,_______), -/*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ + [_VIM] = LAYOUT_JD45( + /*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + /*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ + _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, _______, + /*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + /*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + /*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ -/* Media + /* Media * ,---------+------+------+------+------+------+------+------+------+------+------+------+------. * | | | | | | | | | | | | | | * |---------`------`------`------`------`------`------`------`------`------`------`------`------| @@ -234,53 +236,63 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | | * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' */ -[_MEDIA] = KEYMAP_JD45( -/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ - _______,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, -/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ - _______ ,_______, _______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_MUTE, _______, KC_MPLY , -/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ - _______ ,_______, _______, _______, _______, _______, _______, KC_VOLD, KC_VOLU, _______, _______, _______ , -/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ - _______ , _______, _______, _______, _______ , _______ , _______, _______, _______, _______) -/*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ + [_MEDIA] = LAYOUT_JD45( + /*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + /*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ + _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_MUTE, _______, KC_MPLY, + /*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ + _______, _______, _______, _______, _______, _______, _______, KC_VOLD, KC_VOLU, _______, _______, _______, + /*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______) + /*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ }; -void persistant_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); +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) { +bool process_record_user(uint16_t keycode, keyrecord_t *record) +{ + switch (keycode) + { case QWERTY: - if (record->event.pressed) { - default_layer_set(1UL<<_QWERTY); - } - return false; - break; + if (record->event.pressed) + { + default_layer_set(1UL << _QWERTY); + } + 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; + 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; - } - return true; + 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; + } + return true; } /* @@ -288,54 +300,69 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { */ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - if (!eeconfig_is_enabled()) { - eeconfig_init(); + if (!eeconfig_is_enabled()) + { + eeconfig_init(); } - bool use_cmd = true; // Use, for example, Cmd-Tab, Cmd-C, Cmd-V, etc. + 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. + if (keymap_config.swap_lalt_lgui == 1 && keymap_config.swap_ralt_rgui == 1) + { + use_cmd = false; // ... or, Alt-Tab, Ctrl-C, Ctrl-V, etc. } - switch (id) { - case KC_ALT_TAB: - 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 )); } - 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 )); } + switch (id) + { + case KC_ALT_TAB: + 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)); + } + 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)); + } - case KC_CTL_TAB: - return (record->event.pressed ? MACRO( D(LCTRL), D(TAB), END ) : MACRO( U(TAB), END )); - case KC_CMD_SLSH: - return (record->event.pressed ? MACRO( D(LGUI), D(SLSH),END ) : MACRO( U(SLSH),END )); + case KC_CTL_TAB: + return (record->event.pressed ? MACRO(D(LCTRL), D(TAB), END) : MACRO(U(TAB), END)); + case KC_CMD_SLSH: + return (record->event.pressed ? MACRO(D(LGUI), D(SLSH), END) : MACRO(U(SLSH), END)); - 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 ); + 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); - case KC_AG_DESK_L: - return use_cmd ? MACRODOWN( D(LGUI), D(LCTRL), T(SCLN), END ) : MACRODOWN( D(LALT), D(LCTRL), T(SCLN), END ); - case KC_AG_DESK_R: - return use_cmd ? MACRODOWN( D(LGUI), D(LCTRL), T(QUOT), END ) : MACRODOWN( D(LALT), D(LCTRL), T(QUOT), END ); + case KC_AG_DESK_L: + return use_cmd ? MACRODOWN(D(LGUI), D(LCTRL), T(SCLN), END) : MACRODOWN(D(LALT), D(LCTRL), T(SCLN), END); + case KC_AG_DESK_R: + return use_cmd ? MACRODOWN(D(LGUI), D(LCTRL), T(QUOT), END) : MACRODOWN(D(LALT), D(LCTRL), T(QUOT), END); - case KC_AG_TAB_C: - return use_cmd ? MACRODOWN( D(LGUI), T(W), END ) : MACRODOWN( D(LCTRL), T(W), END ); - case KC_AG_TAB_N: - return use_cmd ? MACRODOWN( D(LGUI), T(T), END ) : MACRODOWN( D(LCTRL), T(T), END ); - case KC_AG_TAB_R: - return use_cmd ? MACRODOWN( D(LGUI), D(LSHIFT), T(T), END ) : MACRODOWN( D(LCTRL), D(LSHIFT), T(T), END ); + case KC_AG_TAB_C: + return use_cmd ? MACRODOWN(D(LGUI), T(W), END) : MACRODOWN(D(LCTRL), T(W), END); + case KC_AG_TAB_N: + return use_cmd ? MACRODOWN(D(LGUI), T(T), END) : MACRODOWN(D(LCTRL), T(T), END); + case KC_AG_TAB_R: + return use_cmd ? MACRODOWN(D(LGUI), D(LSHIFT), T(T), END) : MACRODOWN(D(LCTRL), D(LSHIFT), T(T), END); } return MACRO_NONE; diff --git a/keyboards/jd45/keymaps/default/keymap.c b/keyboards/jd45/keymaps/default/keymap.c index 95abb1505c..0bb519f5fc 100644 --- a/keyboards/jd45/keymaps/default/keymap.c +++ b/keyboards/jd45/keymaps/default/keymap.c @@ -1,15 +1,15 @@ -#include "jd45.h" +#include QMK_KEYBOARD_H /* this keymap is to provide a basic keyboard layout for testing the matrix * for more practical and complicated keymap refer to other keymaps in the same folder */ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = KEYMAP( - ESC, Q, W, E, R, T, Y, U, I, O, P, QUOT, BSPC, - TAB, A, S, D, F, G, H, J, K, L, SCLN, ENT, - LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT, - PAUSE, LCTL, LALT, DEL, SPC, DEL, LEFT, UP, DOWN, RIGHT ), + [0] = LAYOUT( + ESC, Q, W, E, R, T, Y, U, I, O, P, QUOT, BSPC, + TAB, A, S, D, F, G, H, J, K, L, SCLN, ENT, + LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT, + PAUSE, LCTL, LALT, DEL, SPC, DEL, LEFT, UP, DOWN, RIGHT), }; const uint16_t PROGMEM fn_actions[] = { diff --git a/keyboards/jd45/keymaps/jeebak/config.h b/keyboards/jd45/keymaps/jeebak/config.h index 53a1f0a307..bfaa128937 100644 --- a/keyboards/jd45/keymaps/jeebak/config.h +++ b/keyboards/jd45/keymaps/jeebak/config.h @@ -3,7 +3,7 @@ /** *JD45 keymap definition macro */ -#define KEYMAP_JD45( \ +#define LAYOUT_JD45( \ K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, K13, \ K14, K15, K16, K17, K18, K19, K20, K21, K22, K23, K24, K25, \ K26, K27, K28, K29, K30, K31, K32, K33, K34, K35, K36, K37, \ diff --git a/keyboards/jd45/keymaps/jeebak/keymap.c b/keyboards/jd45/keymaps/jeebak/keymap.c index 0da114a1ed..c711939fcf 100644 --- a/keyboards/jd45/keymaps/jeebak/keymap.c +++ b/keyboards/jd45/keymaps/jeebak/keymap.c @@ -1,4 +1,4 @@ -#include "jd45.h" +#include QMK_KEYBOARD_H extern keymap_config_t keymap_config; @@ -17,33 +17,35 @@ extern keymap_config_t keymap_config; #define _ADJUST 16 // Keycodes -enum planck_keycodes { - QWERTY = SAFE_RANGE, - COLEMAK, - DVORAK, - PLOVER, - LOWER, - RAISE, - BACKLIT, - EXT_PLV +enum planck_keycodes +{ + QWERTY = SAFE_RANGE, + COLEMAK, + DVORAK, + PLOVER, + LOWER, + RAISE, + BACKLIT, + EXT_PLV }; -enum macro_keycodes { - KC_ALT_TAB, - KC_CMD_TAB, - KC_CTL_TAB, - KC_CMD_SLSH, - KC_AG_FIND, - KC_AG_AGAIN, - KC_AG_UNDO, - KC_AG_CUT, - KC_AG_COPY, - KC_AG_PASTE, - KC_AG_DESK_L, - KC_AG_DESK_R, - KC_AG_TAB_C, - KC_AG_TAB_N, - KC_AG_TAB_R, +enum macro_keycodes +{ + KC_ALT_TAB, + KC_CMD_TAB, + KC_CTL_TAB, + KC_CMD_SLSH, + KC_AG_FIND, + KC_AG_AGAIN, + KC_AG_UNDO, + KC_AG_CUT, + KC_AG_COPY, + KC_AG_PASTE, + KC_AG_DESK_L, + KC_AG_DESK_R, + KC_AG_TAB_C, + KC_AG_TAB_N, + KC_AG_TAB_R, }; // Fillers to make layering more clear @@ -51,29 +53,29 @@ enum macro_keycodes { #define XXXXXXX KC_NO // Custom macros -#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl -#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift -#define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper -#define GUI_SEM GUI_T(KC_SCLN) // Tap for Semicolon, hold for GUI -#define ALT_QUO ALT_T(KC_QUOT) // Tap for Quote, hold for Alt +#define CTL_ESC CTL_T(KC_ESC) // Tap for Esc, hold for Ctrl +#define SFT_ENT SFT_T(KC_ENT) // Tap for Enter, hold for Shift +#define HPR_TAB ALL_T(KC_TAB) // Tap for Tab, hold for Hyper +#define GUI_SEM GUI_T(KC_SCLN) // Tap for Semicolon, hold for GUI +#define ALT_QUO ALT_T(KC_QUOT) // Tap for Quote, hold for Alt // Requires KC_TRNS/_______ for the trigger key in the destination layer -#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 -#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 -#define CMD_SLSH M(KC_CMD_SLSH) // Macro for Cmd-Slash (personal shortcut to toggle iTerm2 visibility) -#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) -#define AG_D_L M(KC_AG_DESK_L) // For Virtual Desktop Switching: Left, and -#define AG_D_R M(KC_AG_DESK_R) // Right -#define AG_T_C M(KC_AG_TAB_C) // For Chrome, etc. Tab Close, -#define AG_T_N M(KC_AG_TAB_N) // Tab New, and -#define AG_T_R M(KC_AG_TAB_R) // Tab Reopen Closed +#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 +#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 +#define CMD_SLSH M(KC_CMD_SLSH) // Macro for Cmd-Slash (personal shortcut to toggle iTerm2 visibility) +#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) +#define AG_D_L M(KC_AG_DESK_L) // For Virtual Desktop Switching: Left, and +#define AG_D_R M(KC_AG_DESK_R) // Right +#define AG_T_C M(KC_AG_TAB_C) // For Chrome, etc. Tab Close, +#define AG_T_N M(KC_AG_TAB_N) // Tab New, and +#define AG_T_R M(KC_AG_TAB_R) // Tab Reopen Closed /* Qwerty * @@ -89,18 +91,18 @@ enum macro_keycodes { */ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[_QWERTY] = KEYMAP_JD45( -/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ - HPR_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_BSPC, -/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ - CTL_ESC , KC_A, KC_S,LT_MC(KC_D), KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, GUI_SEM, ALT_QUO , -/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ - KC_LSFT , KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT , -/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ - KC_RGUI , KC_LALT , KC_LGUI , LOWER , LT_TC , LT_TC , RAISE , KC_VOLD , KC_VOLU , KC_MPLY), -/*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ + [_QWERTY] = LAYOUT_JD45( + /*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ + HPR_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC, KC_BSPC, + /*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ + CTL_ESC, KC_A, KC_S, LT_MC(KC_D), KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, GUI_SEM, ALT_QUO, + /*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT, + /*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ + KC_RGUI, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, KC_VOLD, KC_VOLU, KC_MPLY), + /*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ -/* Colemak + /* Colemak * ,---------+------+------+------+------+------+------+------+------+------+------+------+------. * |Hyper/Tab| Q | W | F | P | G | J | L | U | Y | ; | Bksp | Bksp | * |---------`------`------`------`------`------`------`------`------`------`------`------`------| @@ -111,18 +113,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | RGUI | Alt | GUI | Lower | TC/Space | TC/Space | Raise | Vol- | Vol+ | Play | * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' */ -[_COLEMAK] = KEYMAP_JD45( -/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ - HPR_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, KC_BSPC, -/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ - 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 , -/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ - KC_LSFT , KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT , -/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ - KC_RGUI , KC_LALT , KC_LGUI , LOWER , LT_TC , LT_TC , RAISE , KC_VOLD , KC_VOLU , KC_MPLY), -/*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ + [_COLEMAK] = LAYOUT_JD45( + /*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ + HPR_TAB, KC_Q, KC_W, KC_F, KC_P, KC_G, KC_J, KC_L, KC_U, KC_Y, KC_SCLN, KC_BSPC, KC_BSPC, + /*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ + 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, + /*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ + KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_ENT, + /*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ + KC_RGUI, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, KC_VOLD, KC_VOLU, KC_MPLY), + /*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ -/* Dvorak + /* Dvorak * ,---------+------+------+------+------+------+------+------+------+------+------+------+------. * |Hyper/Tab| " | , | . | P | Y | F | G | C | R | L | Bksp | Bksp | * |---------`------`------`------`------`------`------`------`------`------`------`------`------| @@ -133,18 +135,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | RGUI | Alt | GUI | Lower | TC/Space | TC/Space | Raise | Vol- | Vol+ | Play | * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' */ -[_DVORAK] = KEYMAP_JD45( -/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ - HPR_TAB,KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, KC_BSPC, -/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ - 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 , -/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ - KC_LSFT , KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT , -/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ - KC_RGUI , KC_LALT , KC_LGUI , LOWER , LT_TC , LT_TC , RAISE , KC_VOLD , KC_VOLU , KC_MPLY), -/*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ + [_DVORAK] = LAYOUT_JD45( + /*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ + HPR_TAB, KC_QUOT, KC_COMM, KC_DOT, KC_P, KC_Y, KC_F, KC_G, KC_C, KC_R, KC_L, KC_BSPC, KC_BSPC, + /*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ + 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, + /*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ + KC_LSFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, SFT_ENT, + /*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ + KC_RGUI, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, KC_VOLD, KC_VOLU, KC_MPLY), + /*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ -/* Lower + /* Lower * ,---------+------+------+------+------+------+------+------+------+------+------+------+------. * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | Bksp | * |---------`------`------`------`------`------`------`------`------`------`------`------`------| @@ -155,18 +157,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Brite | | | | | | | Prev | Next | Mute | * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' */ -[_LOWER] = KEYMAP_JD45( -/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ - 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_BSPC, -/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ - 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 , -/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ - BACKLIT , _______, _______, _______, _______ , _______ , _______, KC_MPRV, KC_MNXT, KC_MUTE), -/*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ + [_LOWER] = LAYOUT_JD45( + /*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ + 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_BSPC, + /*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ + 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, + /*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ + BACKLIT, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_MUTE), + /*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ -/* Raise + /* Raise * ,---------+------+------+------+------+------+------+------+------+------+------+------+------. * | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | Bksp | * |---------`------`------`------`------`------`------`------`------`------`------`------`------| @@ -177,18 +179,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | Brite | | | | | | | Prev | Next | Mute | * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' */ -[_RAISE] = KEYMAP_JD45( -/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ - KC_0 , KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, KC_BSPC, -/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ - 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 , -/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ - BACKLIT , _______, _______, _______, _______ , _______ , _______, KC_MPRV, KC_MNXT, KC_MUTE), -/*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ + [_RAISE] = LAYOUT_JD45( + /*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ + KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC, KC_BSPC, + /*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ + 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, + /*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ + BACKLIT, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_MUTE), + /*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ -/* TouchCursor layer (http://martin-stone.github.io/touchcursor/) plus personal customizations + /* TouchCursor layer (http://martin-stone.github.io/touchcursor/) plus personal customizations * ,---------+------+------+------+------+------+------+------+------+------+------+------+------. * | AltTab |CmdTab|CtlTab| GUI |Shift | ~ |Insert| Home | Up | End | Bksp | | | * |---------`------`------`------`------`------`------`------`------`------`------`------`------| @@ -203,18 +205,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * seem to work on Mac. Presumably they'll work under Windows. */ -[_TOUCHCURSOR] = KEYMAP_JD45( -/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ - ALT_TAB,CMD_TAB, CTL_TAB, KC_LGUI, KC_LSFT, KC_TILD, KC_INS, KC_HOME, KC_UP, KC_END, KC_BSPC, _______, _______, -/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ - _______ ,KC_LALT, KC_SPC, AG_T_C, AG_FIND,AG_AGAIN, KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, AG_D_L, AG_D_R , -/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ - _______ ,AG_UNDO, AG_CUT, AG_COPY,AG_PASTE, KC_GRV, KC_PGDN, KC_DEL, AG_T_N, AG_T_R,CMD_SLSH, _______ , -/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ - _______ , _______, _______, _______, _______ , _______ , _______, _______, _______, _______), -/*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ + [_TOUCHCURSOR] = LAYOUT_JD45( + /*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ + ALT_TAB, CMD_TAB, CTL_TAB, KC_LGUI, KC_LSFT, KC_TILD, KC_INS, KC_HOME, KC_UP, KC_END, KC_BSPC, _______, _______, + /*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ + _______, KC_LALT, KC_SPC, AG_T_C, AG_FIND, AG_AGAIN, KC_PGUP, KC_LEFT, KC_DOWN, KC_RGHT, AG_D_L, AG_D_R, + /*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ + _______, AG_UNDO, AG_CUT, AG_COPY, AG_PASTE, KC_GRV, KC_PGDN, KC_DEL, AG_T_N, AG_T_R, CMD_SLSH, _______, + /*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + /*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ -/* Mouse Layer + /* Mouse Layer * ,---------+------+------+------+------+------+------+------+------+------+------+------+------. * | | |ACCL0 | | | | |WHL_L | Up |WHL_R | BTN2 | | | * |---------`------`------`------`------`------`------`------`------`------`------`------`------| @@ -226,18 +228,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' */ -[_MOUSECURSOR] = KEYMAP_JD45( -/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ - _______,_______, 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 , -/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ - _______ ,_______, _______, _______, KC_BTN3, _______, KC_WH_D, KC_BTN1, _______, _______, KC_BTN3, _______ , -/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ - _______ , _______, _______, _______, _______, _______, _______, _______, _______, _______), -/*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ + [_MOUSECURSOR] = LAYOUT_JD45( + /*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ + _______, _______, 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, + /*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ + _______, _______, _______, _______, KC_BTN3, _______, KC_WH_D, KC_BTN1, _______, _______, KC_BTN3, _______, + /*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______), + /*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ -/* Plover layer (http://opensteno.org) + /* Plover layer (http://opensteno.org) * ,---------+------+------+------+------+------+------+------+------+------+------+------+------. * | # | # | # | # | # | # | # | # | # | # | # | # | # | * |---------`------`------`------`------`------`------`------`------`------`------`------`------| @@ -249,18 +251,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' */ -[_PLOVER] = KEYMAP_JD45( -/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ - 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_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT , -/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ - EXT_PLV , XXXXXXX, KC_C, KC_V, XXXXXXX , XXXXXXX , KC_N, KC_M, XXXXXXX, XXXXXXX), -/*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ + [_PLOVER] = LAYOUT_JD45( + /*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ + 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_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT, + /*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ + EXT_PLV, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX), + /*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ -/* Adjust (Lower + Raise) + /* Adjust (Lower + Raise) * ,---------+------+------+------+------+------+------+------+------+------+------+------+------. * | | | | | | | | | | | | | Del | * |---------`------`------`------`------`------`------`------`------`------`------`------`------| @@ -271,97 +273,115 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { * | | | | | | | | | | Reset | * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' */ -[_ADJUST] = KEYMAP_JD45( -/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ - _______,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL , -/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ - _______ ,_______, _______, _______, _______, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______ , -/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ - _______ ,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ , -/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ - _______ , _______, _______, _______, _______ , _______ , _______, _______, _______, RESET) -/*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ + [_ADJUST] = LAYOUT_JD45( + /*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL, + /*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ + _______, _______, _______, _______, _______, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______, + /*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ + _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, + /*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ + _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET) + /*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ }; -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); +void persistent_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) { +bool process_record_user(uint16_t keycode, keyrecord_t *record) +{ + switch (keycode) + { case QWERTY: - if (record->event.pressed) { - default_layer_set(1UL<<_QWERTY); - } - return false; - break; + if (record->event.pressed) + { + default_layer_set(1UL << _QWERTY); + } + return false; + break; case COLEMAK: - if (record->event.pressed) { - default_layer_set(1UL<<_COLEMAK); - } - return false; - break; + if (record->event.pressed) + { + default_layer_set(1UL << _COLEMAK); + } + return false; + break; case DVORAK: - if (record->event.pressed) { - default_layer_set(1UL<<_DVORAK); - } - return false; - break; + if (record->event.pressed) + { + default_layer_set(1UL << _DVORAK); + } + 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; + 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; + 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; + 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) { - layer_off(_RAISE); - layer_off(_LOWER); - layer_off(_ADJUST); - layer_on(_PLOVER); - if (!eeconfig_is_enabled()) { - eeconfig_init(); + if (record->event.pressed) + { + 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); } - keymap_config.raw = eeconfig_read_keymap(); - keymap_config.nkro = 1; - eeconfig_update_keymap(keymap_config.raw); - } - return false; - break; + return false; + break; case EXT_PLV: - if (record->event.pressed) { - layer_off(_PLOVER); - } - return false; - break; - } - return true; + if (record->event.pressed) + { + layer_off(_PLOVER); + } + return false; + break; + } + return true; } /* @@ -369,54 +389,69 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { */ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - if (!eeconfig_is_enabled()) { - eeconfig_init(); + if (!eeconfig_is_enabled()) + { + eeconfig_init(); } - bool use_cmd = true; // Use, for example, Cmd-Tab, Cmd-C, Cmd-V, etc. + 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. + if (keymap_config.swap_lalt_lgui == 1 && keymap_config.swap_ralt_rgui == 1) + { + use_cmd = false; // ... or, Alt-Tab, Ctrl-C, Ctrl-V, etc. } - switch (id) { - case KC_ALT_TAB: - 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 )); } - 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 )); } + switch (id) + { + case KC_ALT_TAB: + 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)); + } + 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)); + } - case KC_CTL_TAB: - return (record->event.pressed ? MACRO( D(LCTRL), D(TAB), END ) : MACRO( U(TAB), END )); - case KC_CMD_SLSH: - return (record->event.pressed ? MACRO( D(LGUI), D(SLSH),END ) : MACRO( U(SLSH),END )); + case KC_CTL_TAB: + return (record->event.pressed ? MACRO(D(LCTRL), D(TAB), END) : MACRO(U(TAB), END)); + case KC_CMD_SLSH: + return (record->event.pressed ? MACRO(D(LGUI), D(SLSH), END) : MACRO(U(SLSH), END)); - 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 ); + 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); - case KC_AG_DESK_L: - return use_cmd ? MACRODOWN( D(LGUI), D(LCTRL), T(SCLN), END ) : MACRODOWN( D(LALT), D(LCTRL), T(SCLN), END ); - case KC_AG_DESK_R: - return use_cmd ? MACRODOWN( D(LGUI), D(LCTRL), T(QUOT), END ) : MACRODOWN( D(LALT), D(LCTRL), T(QUOT), END ); + case KC_AG_DESK_L: + return use_cmd ? MACRODOWN(D(LGUI), D(LCTRL), T(SCLN), END) : MACRODOWN(D(LALT), D(LCTRL), T(SCLN), END); + case KC_AG_DESK_R: + return use_cmd ? MACRODOWN(D(LGUI), D(LCTRL), T(QUOT), END) : MACRODOWN(D(LALT), D(LCTRL), T(QUOT), END); - case KC_AG_TAB_C: - return use_cmd ? MACRODOWN( D(LGUI), T(W), END ) : MACRODOWN( D(LCTRL), T(W), END ); - case KC_AG_TAB_N: - return use_cmd ? MACRODOWN( D(LGUI), T(T), END ) : MACRODOWN( D(LCTRL), T(T), END ); - case KC_AG_TAB_R: - return use_cmd ? MACRODOWN( D(LGUI), D(LSHIFT), T(T), END ) : MACRODOWN( D(LCTRL), D(LSHIFT), T(T), END ); + case KC_AG_TAB_C: + return use_cmd ? MACRODOWN(D(LGUI), T(W), END) : MACRODOWN(D(LCTRL), T(W), END); + case KC_AG_TAB_N: + return use_cmd ? MACRODOWN(D(LGUI), T(T), END) : MACRODOWN(D(LCTRL), T(T), END); + case KC_AG_TAB_R: + return use_cmd ? MACRODOWN(D(LGUI), D(LSHIFT), T(T), END) : MACRODOWN(D(LCTRL), D(LSHIFT), T(T), END); } return MACRO_NONE; diff --git a/keyboards/jd45/keymaps/justin/keymap.c b/keyboards/jd45/keymaps/justin/keymap.c index c278abba55..a797582b07 100644 --- a/keyboards/jd45/keymaps/justin/keymap.c +++ b/keyboards/jd45/keymaps/justin/keymap.c @@ -1,58 +1,59 @@ -#include "jd45.h" +#include QMK_KEYBOARD_H const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = KEYMAP( - ESC, Q, W, F, P, G, J, L, U, Y, SCLN, QUOT, BSPC, - FN8, A, R, S, T, D, H, N, E, I, O, ENT, - LSFT, Z, X, C, V, B, K, M, COMM, DOT, SLSH, FN6, - FN4, LGUI, FN7, FN2, FN1, SPC, FN5, RALT, FN3, FN0 ), -[1] = KEYMAP( - TRNS, FN10, FN11, FN12, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, UP, DEL, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, HOME, PGUP, LEFT, RGHT, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, END, PGDN, DOWN, TRNS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS ), -[2] = KEYMAP( - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, 7, 8, 9, 0, TRNS, TRNS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, LBRC, 4, 5, 6, DOT, TRNS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, RBRC, 1, 2, 3, BSLS, TRNS, - TRNS,FN29, TRNS, TRNS, TRNS, PAUSE, EQL, MINS, TRNS, TRNS ), -[3] = KEYMAP( - TRNS, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS ), -[4] = KEYMAP( - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, 7, 8, 9, 0, TRNS, TRNS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, LBRC, 4, 5, 6, DOT, TRNS, - TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, RBRC, 1, 2, 3, BSLS, TRNS, - TRNS,FN29, TRNS, TRNS, TRNS, PAUSE, EQL, MINS, TRNS, TRNS ), + [0] = LAYOUT( + ESC, Q, W, F, P, G, J, L, U, Y, SCLN, QUOT, BSPC, + FN8, A, R, S, T, D, H, N, E, I, O, ENT, + LSFT, Z, X, C, V, B, K, M, COMM, DOT, SLSH, FN6, + FN4, LGUI, FN7, FN2, FN1, SPC, FN5, RALT, FN3, FN0), + [1] = LAYOUT( + TRNS, FN10, FN11, FN12, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, UP, DEL, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, HOME, PGUP, LEFT, RGHT, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, END, PGDN, DOWN, TRNS, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), + [2] = LAYOUT( + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, 7, 8, 9, 0, TRNS, TRNS, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, LBRC, 4, 5, 6, DOT, TRNS, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, RBRC, 1, 2, 3, BSLS, TRNS, + TRNS, FN29, TRNS, TRNS, TRNS, PAUSE, EQL, MINS, TRNS, TRNS), + [3] = LAYOUT( + TRNS, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS), + [4] = LAYOUT( + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, 7, 8, 9, 0, TRNS, TRNS, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, LBRC, 4, 5, 6, DOT, TRNS, + TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, RBRC, 1, 2, 3, BSLS, TRNS, + TRNS, FN29, TRNS, TRNS, TRNS, PAUSE, EQL, MINS, TRNS, TRNS), }; -enum macro_id { - PSWD1, - PSWD2, - PSWD3, +enum macro_id +{ + PSWD1, + PSWD2, + PSWD3, }; const uint16_t PROGMEM fn_actions[] = { [0] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_MINS), - [1] = ACTION_LAYER_MOMENTARY(1), // FN1 - [2] = ACTION_LAYER_MOMENTARY(2), // FN2 - [3] = ACTION_LAYER_MOMENTARY(3), // FN3 + [1] = ACTION_LAYER_MOMENTARY(1), // FN1 + [2] = ACTION_LAYER_MOMENTARY(2), // FN2 + [3] = ACTION_LAYER_MOMENTARY(3), // FN3 [4] = ACTION_MODS_TAP_KEY(MOD_LSFT, KC_GRV), [5] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_RGUI), [6] = ACTION_MODS_TAP_KEY(MOD_RSFT, KC_CAPS), - [7] = ACTION_LAYER_MODS(4, MOD_LSFT), // FN4 + [7] = ACTION_LAYER_MODS(4, MOD_LSFT), // FN4 [8] = ACTION_MODS_TAP_KEY(MOD_LCTL, KC_TAB), [10] = ACTION_MACRO(PSWD1), [11] = ACTION_MACRO(PSWD2), [12] = ACTION_MACRO(PSWD3), - + [29] = ACTION_BACKLIGHT_TOGGLE(), [30] = ACTION_BACKLIGHT_INCREASE(), [31] = ACTION_BACKLIGHT_DECREASE() - + }; /* @@ -60,19 +61,14 @@ const uint16_t PROGMEM fn_actions[] = { */ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - switch (id) { - case PSWD1: - return (record->event.pressed ? - MACRO( I(0), T(1), T(2), T(3), T(4), T(5), T(6), T(7), T(8), T(ENT), END ) : - MACRO_NONE ); - case PSWD2: - return (record->event.pressed ? - MACRO( I(0), T(1), T(2), T(3), T(4), T(5), T(6), T(7), T(8), T(ENT), END ) : - MACRO_NONE ); - case PSWD3: - return (record->event.pressed ? - MACRO( I(0), T(1), T(2), T(3), T(4), T(5), T(6), T(7), T(8), T(ENT), END ) : - MACRO_NONE ); + switch (id) + { + case PSWD1: + return (record->event.pressed ? MACRO(I(0), T(1), T(2), T(3), T(4), T(5), T(6), T(7), T(8), T(ENT), END) : MACRO_NONE); + case PSWD2: + return (record->event.pressed ? MACRO(I(0), T(1), T(2), T(3), T(4), T(5), T(6), T(7), T(8), T(ENT), END) : MACRO_NONE); + case PSWD3: + return (record->event.pressed ? MACRO(I(0), T(1), T(2), T(3), T(4), T(5), T(6), T(7), T(8), T(ENT), END) : MACRO_NONE); //case VOLUP: // return (record->event.pressed ? // MACRO( D(VOLU), U(VOLU), END ) : diff --git a/keyboards/jd45/keymaps/mjt/keymap.c b/keyboards/jd45/keymaps/mjt/keymap.c index 610552ecfa..a53b09642a 100644 --- a/keyboards/jd45/keymaps/mjt/keymap.c +++ b/keyboards/jd45/keymaps/mjt/keymap.c @@ -1,33 +1,34 @@ -#include "jd45.h" +#include QMK_KEYBOARD_H /* Mike's Layout for JD45 with backlight LEDs acting as layer indicator */ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { -[0] = KEYMAP( - TAB, Q, W, E, R, T, Y, U, I, O, P, MINS, BSLS, - FN1, A, S, D, F, G, H, J, K, L, QUOT, ENT, - FN0, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT, - NO, LCTL, LALT, LGUI, SPC, BSPC, APP, FN2, ESC, NO ), -[1] = KEYMAP( -GRV, TRNS, UP, TRNS, 7, 8, 9, 0, MINS, EQL, PSCR, LBRC, RBRC, -TRNS, LEFT, DOWN, RGHT, 4, 5, 6, INS, HOME, PGUP, SCLN, TRNS, -TRNS, TRNS, TRNS, TRNS, 1, 2, 3, DEL, END, PGDN, TRNS, TRNS, -TRNS, TRNS, TRNS, SPC, TRNS, DEL, TRNS, FN3, TRNS, TRNS ), -[2] = KEYMAP( -TRNS, TRNS, VOLU, TRNS, F7, F8, F9, F10, F11, F12, PSCR, FN3, FN4, -TRNS, MPRV, VOLD, MNXT, F4, F5, F6, J, K, L, SCLN, TRNS, -TRNS, TRNS, TRNS, TRNS, F1, F2, F3, MUTE, MPRV, MNXT, MSTP, TRNS, -TRNS, TRNS, TRNS, LGUI, TRNS, TRNS, TRNS, TRNS, PAUS, TRNS ) -/* , -[3] = KEYMAP( + [0] = LAYOUT( + TAB, Q, W, E, R, T, Y, U, I, O, P, MINS, BSLS, + FN1, A, S, D, F, G, H, J, K, L, QUOT, ENT, + FN0, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT, + NO, LCTL, LALT, LGUI, SPC, BSPC, APP, FN2, ESC, NO), + [1] = LAYOUT( + GRV, TRNS, UP, TRNS, 7, 8, 9, 0, MINS, EQL, PSCR, LBRC, RBRC, + TRNS, LEFT, DOWN, RGHT, 4, 5, 6, INS, HOME, PGUP, SCLN, TRNS, + TRNS, TRNS, TRNS, TRNS, 1, 2, 3, DEL, END, PGDN, TRNS, TRNS, + TRNS, TRNS, TRNS, SPC, TRNS, DEL, TRNS, FN3, TRNS, TRNS), + [2] = LAYOUT( + TRNS, TRNS, VOLU, TRNS, F7, F8, F9, F10, F11, F12, PSCR, FN3, FN4, + TRNS, MPRV, VOLD, MNXT, F4, F5, F6, J, K, L, SCLN, TRNS, + TRNS, TRNS, TRNS, TRNS, F1, F2, F3, MUTE, MPRV, MNXT, MSTP, TRNS, + TRNS, TRNS, TRNS, LGUI, TRNS, TRNS, TRNS, TRNS, PAUS, TRNS) + /* , +[3] = LAYOUT( TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, BTLD, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS )*/ }; -enum macro_id { +enum macro_id +{ M_LAYER1, M_LAYER2 }; @@ -38,43 +39,43 @@ const uint16_t PROGMEM fn_actions[] = { [1] = ACTION_MACRO(M_LAYER1), [2] = ACTION_LAYER_TAP_TOGGLE(2), [3] = ACTION_BACKLIGHT_STEP(), - [4] = ACTION_BACKLIGHT_TOGGLE() -}; + [4] = ACTION_BACKLIGHT_TOGGLE()}; const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) { - // MACRODOWN only works in this function - switch(id) { - case M_LAYER1: - // need to add a timer for doubletap: https://github.com/jackhumbert/qmk_firmware/wiki#timer-functionality - // action_function_tap may also handle this... - if (record->event.pressed) - { - breathing_period_set(3); - breathing_enable(); - layer_on(1); - } - else - { - breathing_period_set(1); - breathing_self_disable(); - layer_off(1); - } + // MACRODOWN only works in this function + switch (id) + { + case M_LAYER1: + // need to add a timer for doubletap: https://github.com/jackhumbert/qmk_firmware/wiki#timer-functionality + // action_function_tap may also handle this... + if (record->event.pressed) + { + breathing_period_set(3); + breathing_enable(); + layer_on(1); + } + else + { + breathing_period_set(1); + breathing_self_disable(); + layer_off(1); + } break; - case M_LAYER2: - if (record->event.pressed) - { - breathing_period_set(2); - breathing_pulse(); - layer_on(2); - } - else - { - breathing_period_set(1); - breathing_self_disable(); - layer_off(2); - } + case M_LAYER2: + if (record->event.pressed) + { + breathing_period_set(2); + breathing_pulse(); + layer_on(2); + } + else + { + breathing_period_set(1); + breathing_self_disable(); + layer_off(2); + } break; - } + } return MACRO_NONE; }; diff --git a/keyboards/jd45/keymaps/mjt6u/keymap.c b/keyboards/jd45/keymaps/mjt6u/keymap.c index 44f0c31db3..c17a07fd04 100644 --- a/keyboards/jd45/keymaps/mjt6u/keymap.c +++ b/keyboards/jd45/keymaps/mjt6u/keymap.c @@ -1,23 +1,23 @@ -#include "jd45.h" +#include QMK_KEYBOARD_H enum jd45_layers { - _QWERTY, - _QWERTYNUMMODS, - _NUMSYM, - _FUNCTION, - _NUMPAD, - _FKEYNUMPAD, - _ADJUST + _QWERTY, + _QWERTYNUMMODS, + _NUMSYM, + _FUNCTION, + _NUMPAD, + _FKEYNUMPAD, + _ADJUST }; enum jd45_keycodes { - NUMSYM = SAFE_RANGE, - MACSLEEP, - USEFNMODS, - USENUMMODS, - DYNAMIC_MACRO_RANGE, + NUMSYM = SAFE_RANGE, + MACSLEEP, + USEFNMODS, + USENUMMODS, + DYNAMIC_MACRO_RANGE, }; #include "dynamic_macro.h" @@ -33,117 +33,91 @@ enum jd45_keycodes #define F_FNTAB F(2) const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_QWERTY] = { - {F_FNTAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, KC_BSPC}, - {CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, LT(_ADJUST, KC_QUOT)}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT)}, - { XXXXXXX, KC_LALT, KC_LGUI, XXXXXXX, XXXXXXX, XXXXXXX, F_FNSPC, XXXXXXX, XXXXXXX, MO(_FUNCTION), MO(_ADJUST) } -}, -[_QWERTYNUMMODS] = { - {F_FNTAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, KC_BSPC}, - {CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, LT(_ADJUST, KC_QUOT)}, - {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT)}, - {XXXXXXX, KC_LALT, KC_LGUI, XXXXXXX, XXXXXXX, XXXXXXX, F_NUMSPC, XXXXXXX, XXXXXXX, MO(_FKEYNUMPAD), MO(_ADJUST) } -}, -[_NUMSYM] = { -{KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, KC_DEL}, - {__MOD__, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, _______}, - {_______, _______, _______, _______, _______, KC_SPC, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, _______}, -{XXXXXXX, __MOD__, __MOD__, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, __MOD__, __MOD__} -}, -[_FUNCTION] = { -{__MOD__, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12}, -{__MOD__, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT, _______, _______}, -{_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, -{XXXXXXX, __MOD__, __MOD__, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, __MOD__ , __MOD__} -}, -[_NUMPAD] = { -{KC_GRV, _______, KC_UP, _______, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_PSCR, KC_LBRC, KC_RBRC}, -{_______, KC_LEFT, KC_DOWN, KC_RGHT, KC_4, KC_5, KC_6, KC_INS, KC_HOME, KC_PGUP, _______, _______}, -{_______, _______, _______, _______, KC_1, KC_2, KC_3, KC_DEL, KC_END, KC_PGDN, _______, _______}, -{XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, __MOD__, __MOD__} -}, -[_FKEYNUMPAD] = { -{_______, _______, KC_VOLU, _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, _______, _______}, -{_______, KC_MPRV, KC_VOLD, KC_MNXT, KC_F4, KC_F5, KC_F6, KC_J, KC_K, KC_L, KC_SCLN, _______}, -{_______, _______, _______, _______, KC_F1, KC_F2, KC_F3, KC_MUTE, KC_MPRV, KC_MNXT, KC_MSTP, _______}, -{XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, __MOD__, __MOD__ } -}, -[_ADJUST] = { - {_______, RESET, _______, _______, _______, _______, _______, DYN_REC_START1, DYN_REC_START2, _______, KC_PSCR, _______, _______}, - { _______, _______, _______, _______, USEFNMODS, _______, _______, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, MACSLEEP, _______, _______}, - { _______, _______, _______, _______, _______, _______, USENUMMODS, _______, _______, _______, _______, _______}, - {XXXXXXX, _______, _______,XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, __MOD__, __MOD__} - } -}; - + [_QWERTY] = { + {F_FNTAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, KC_BSPC}, + {CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, LT(_ADJUST, KC_QUOT)}, + {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT)}, + {XXXXXXX, KC_LALT, KC_LGUI, XXXXXXX, XXXXXXX, XXXXXXX, F_FNSPC, XXXXXXX, XXXXXXX, MO(_FUNCTION), MO(_ADJUST)}}, + [_QWERTYNUMMODS] = {{F_FNTAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_MINS, KC_BSPC}, {CTL_T(KC_ESC), KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, LT(_ADJUST, KC_QUOT)}, {KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, SFT_T(KC_ENT)}, {XXXXXXX, KC_LALT, KC_LGUI, XXXXXXX, XXXXXXX, XXXXXXX, F_NUMSPC, XXXXXXX, XXXXXXX, MO(_FKEYNUMPAD), MO(_ADJUST)}}, + [_NUMSYM] = {{KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______, KC_DEL}, {__MOD__, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, _______}, {_______, _______, _______, _______, _______, KC_SPC, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS, _______}, {XXXXXXX, __MOD__, __MOD__, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, __MOD__, __MOD__}}, + [_FUNCTION] = {{__MOD__, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12}, {__MOD__, _______, _______, _______, _______, _______, KC_MPRV, KC_VOLD, KC_VOLU, KC_MNXT, _______, _______}, {_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______}, {XXXXXXX, __MOD__, __MOD__, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, __MOD__, __MOD__}}, + [_NUMPAD] = {{KC_GRV, _______, KC_UP, _______, KC_7, KC_8, KC_9, KC_0, KC_MINS, KC_EQL, KC_PSCR, KC_LBRC, KC_RBRC}, {_______, KC_LEFT, KC_DOWN, KC_RGHT, KC_4, KC_5, KC_6, KC_INS, KC_HOME, KC_PGUP, _______, _______}, {_______, _______, _______, _______, KC_1, KC_2, KC_3, KC_DEL, KC_END, KC_PGDN, _______, _______}, {XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, __MOD__, __MOD__}}, + [_FKEYNUMPAD] = {{_______, _______, KC_VOLU, _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_PSCR, _______, _______}, {_______, KC_MPRV, KC_VOLD, KC_MNXT, KC_F4, KC_F5, KC_F6, KC_J, KC_K, KC_L, KC_SCLN, _______}, {_______, _______, _______, _______, KC_F1, KC_F2, KC_F3, KC_MUTE, KC_MPRV, KC_MNXT, KC_MSTP, _______}, {XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, __MOD__, __MOD__}}, + [_ADJUST] = {{_______, RESET, _______, _______, _______, _______, _______, DYN_REC_START1, DYN_REC_START2, _______, KC_PSCR, _______, _______}, {_______, _______, _______, _______, USEFNMODS, _______, _______, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2, MACSLEEP, _______, _______}, {_______, _______, _______, _______, _______, _______, USENUMMODS, _______, _______, _______, _______, _______}, {XXXXXXX, _______, _______, XXXXXXX, XXXXXXX, XXXXXXX, _______, XXXXXXX, XXXXXXX, __MOD__, __MOD__}}}; const uint16_t PROGMEM fn_actions[] = { - [0] = ACTION_LAYER_TAP_KEY(_NUMSYM, KC_SPC), - [1] = ACTION_LAYER_TAP_KEY(_NUMPAD, KC_SPC), - [2] = ACTION_LAYER_TAP_KEY(_FUNCTION, KC_TAB), + [0] = ACTION_LAYER_TAP_KEY(_NUMSYM, KC_SPC), + [1] = ACTION_LAYER_TAP_KEY(_NUMPAD, KC_SPC), + [2] = ACTION_LAYER_TAP_KEY(_FUNCTION, KC_TAB), }; -void persistent_default_layer_set(uint16_t default_layer) { - eeconfig_update_default_layer(default_layer); - default_layer_set(default_layer); +void persistent_default_layer_set(uint16_t default_layer) +{ + eeconfig_update_default_layer(default_layer); + default_layer_set(default_layer); } static bool singular_key = false; -bool process_record_user(uint16_t keycode, keyrecord_t *record) { - uint16_t macro_kc = (keycode == MO(_ADJUST) ? DYN_REC_STOP : keycode); - if (!process_record_dynamic_macro(macro_kc, record)) { - return false; - } - println(" "); - print("process record"); - - switch (keycode) { - case MACSLEEP: - if (record->event.pressed) { - // ACTION_MODS_KEY(MOD_LCTL | MOD_LSFT, KC_POWER); - register_code(KC_RSFT); - register_code(KC_RCTL); - register_code(KC_POWER); - unregister_code(KC_POWER); - unregister_code(KC_RCTL); - unregister_code(KC_RSFT); - } - return false; - break; - case USEFNMODS: - if (record->event.pressed) { - persistent_default_layer_set(1UL<<_QWERTY); - #ifdef AUDIO_ENABLE - PLAY_NOTE_ARRAY(tone_fnpc, false, 0); - #endif - print("Space-FN"); +bool process_record_user(uint16_t keycode, keyrecord_t *record) +{ + uint16_t macro_kc = (keycode == MO(_ADJUST) ? DYN_REC_STOP : keycode); + if (!process_record_dynamic_macro(macro_kc, record)) + { + return false; } - return false; - break; - case USENUMMODS: - if (record->event.pressed) { - persistent_default_layer_set(1UL<<_QWERTYNUMMODS); - #ifdef AUDIO_ENABLE - PLAY_NOTE_ARRAY(tone_fnmac, false, 0); - #endif - print("Space-Numpad"); + println(" "); + print("process record"); + + switch (keycode) + { + case MACSLEEP: + if (record->event.pressed) + { + // ACTION_MODS_KEY(MOD_LCTL | MOD_LSFT, KC_POWER); + register_code(KC_RSFT); + register_code(KC_RCTL); + register_code(KC_POWER); + unregister_code(KC_POWER); + unregister_code(KC_RCTL); + unregister_code(KC_RSFT); + } + return false; + break; + case USEFNMODS: + if (record->event.pressed) + { + persistent_default_layer_set(1UL << _QWERTY); +#ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_fnpc, false, 0); +#endif + print("Space-FN"); + } + return false; + break; + case USENUMMODS: + if (record->event.pressed) + { + persistent_default_layer_set(1UL << _QWERTYNUMMODS); +#ifdef AUDIO_ENABLE + PLAY_NOTE_ARRAY(tone_fnmac, false, 0); +#endif + print("Space-Numpad"); + } + return false; + break; + default: + singular_key = false; + break; } - return false; - break; - default: - singular_key = false; - break; - } - return true; + return true; }; - -void matrix_init_user(void) { - #ifdef AUDIO_ENABLE - startup_user(); - #endif +void matrix_init_user(void) +{ +#ifdef AUDIO_ENABLE + startup_user(); +#endif // debug_enable = true; } |