QMK Configurator Support for JD45 and JD40 (#2851)

* Added JD45 Config

* Added JD40 Config

* Changed KEYMAP to LAYOUT for JD40 and JD45
This commit is contained in:
Eric 2018-04-30 23:22:02 +08:00 committed by Drashna Jaelre
parent 43e589aa02
commit 187d76476e
15 changed files with 962 additions and 784 deletions

57
keyboards/jd40/info.json Normal file
View File

@ -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 }
]
}
}
}

View File

@ -30,7 +30,7 @@ inline void gh60_wasd_leds_off(void) { DDRF &= ~(1<<7); PORTF &= ~(1<<7); }
/* JD40 MKII keymap definition macro /* JD40 MKII keymap definition macro
*/ */
#define KEYMAP( \ #define LAYOUT( \
K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, \ K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, \
K13, K14, K15, K16, K17, K18, K19, K20, K21, K22, K23, \ K13, K14, K15, K16, K17, K18, K19, K20, K21, K22, K23, \
K24, K25, K26, K27, K28, K29, K30, K31, K32, K33, K34, \ K24, K25, K26, K27, K28, K29, K30, K31, K32, K33, K34, \

View File

@ -1,4 +1,4 @@
#include "jd40.h" #include QMK_KEYBOARD_H
#include "action_layer.h" #include "action_layer.h"
#define _BL 0 #define _BL 0
@ -7,32 +7,33 @@
#define _UL 3 #define _UL 3
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_BL] = KEYMAP( [_BL] = LAYOUT(
F12, Q, W, E, R, T, Y, U, I, O, P, BSPC, F12, Q, W, E, R, T, Y, U, I, O, P, BSPC,
TAB, A, S, D, F, G, H, J, K, L, ENT, TAB, A, S, D, F, G, H, J, K, L, ENT,
LSFT, Z, X, C, V, B, N, M, COMM, UP, DOT, LSFT, Z, X, C, V, B, N, M, COMM, UP, DOT,
LCTL, LGUI, LALT, FN0, SPC, SPC, FN0, LEFT, DOWN, RIGHT ), LCTL, LGUI, LALT, FN0, SPC, SPC, FN0, LEFT, DOWN, RIGHT),
[_AL] = KEYMAP( [_AL] = LAYOUT(
GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, DEL, GRV, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, DEL,
CAPS, 1, 2, 3, 4, 5, 6, 7, 8, 9, 0, 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, TRNS, TRNS, TRNS, TRNS, SCLN, PGUP, QUOT,
TRNS, TRNS, TRNS, TRNS, FN3, FN3, TRNS, HOME, PGDN, END ), TRNS, TRNS, TRNS, TRNS, FN3, FN3, TRNS, HOME, PGDN, END),
[_FL] = KEYMAP( [_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, 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( [_UL] = 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, FN4, FN5, FN11, FN10, 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, 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_TOGGLE,
RGBLED_STEP_MODE, RGBLED_STEP_MODE,
RGBLED_INCREASE_HUE, RGBLED_INCREASE_HUE,
@ -63,11 +64,15 @@ const uint16_t PROGMEM fn_actions[] = {
const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt) const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{ {
// MACRODOWN only works in this function // MACRODOWN only works in this function
switch(id) { switch (id)
{
case 0: case 0:
if (record->event.pressed) { if (record->event.pressed)
{
register_code(KC_RSFT); register_code(KC_RSFT);
} else { }
else
{
unregister_code(KC_RSFT); unregister_code(KC_RSFT);
} }
break; break;
@ -75,86 +80,112 @@ const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
return MACRO_NONE; return MACRO_NONE;
}; };
void matrix_scan_user(void) { void matrix_scan_user(void)
{
// Layer LED indicators // Layer LED indicators
// ESC led on when in function layer, WASD cluster leds enabled when on arrow cluster // ESC led on when in function layer, WASD cluster leds enabled when on arrow cluster
uint32_t layer = layer_state; uint32_t layer = layer_state;
if (layer & (1<<1)) { if (layer & (1 << 1))
{
//gh60_wasd_leds_on(); //gh60_wasd_leds_on();
} else { }
else
{
//gh60_wasd_leds_off(); //gh60_wasd_leds_off();
} }
if (layer & (1<<2)) { if (layer & (1 << 2))
{
//gh60_esc_led_on(); //gh60_esc_led_on();
} else { }
else
{
//gh60_esc_led_off(); //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) { void action_function(keyrecord_t *record, uint8_t id, uint8_t opt)
switch (id) { {
switch (id)
{
case RGBLED_TOGGLE: case RGBLED_TOGGLE:
//led operations //led operations
if (record->event.pressed) { if (record->event.pressed)
{
rgblight_toggle(); rgblight_toggle();
} }
break; break;
case RGBLED_INCREASE_HUE: case RGBLED_INCREASE_HUE:
if (record->event.pressed) { if (record->event.pressed)
{
rgblight_increase_hue(); rgblight_increase_hue();
} }
break; break;
case RGBLED_DECREASE_HUE: case RGBLED_DECREASE_HUE:
if (record->event.pressed) { if (record->event.pressed)
{
rgblight_decrease_hue(); rgblight_decrease_hue();
} }
break; break;
case RGBLED_INCREASE_SAT: case RGBLED_INCREASE_SAT:
if (record->event.pressed) { if (record->event.pressed)
{
rgblight_increase_sat(); rgblight_increase_sat();
} }
break; break;
case RGBLED_DECREASE_SAT: case RGBLED_DECREASE_SAT:
if (record->event.pressed) { if (record->event.pressed)
{
rgblight_decrease_sat(); rgblight_decrease_sat();
} }
break; break;
case RGBLED_INCREASE_VAL: case RGBLED_INCREASE_VAL:
if (record->event.pressed) { if (record->event.pressed)
{
rgblight_increase_val(); rgblight_increase_val();
} }
break; break;
case RGBLED_DECREASE_VAL: case RGBLED_DECREASE_VAL:
if (record->event.pressed) { if (record->event.pressed)
{
rgblight_decrease_val(); rgblight_decrease_val();
} }
break; break;
case RGBLED_STEP_MODE: case RGBLED_STEP_MODE:
if (record->event.pressed) { if (record->event.pressed)
{
rgblight_step(); rgblight_step();
} }
break; break;
static uint8_t shift_esc_shift_mask; static uint8_t shift_esc_shift_mask;
// Shift + ESC = ~ // Shift + ESC = ~
case SHIFT_ESC: case SHIFT_ESC:
shift_esc_shift_mask = get_mods()&MODS_CTRL_MASK; shift_esc_shift_mask = get_mods() & MODS_CTRL_MASK;
if (record->event.pressed) { if (record->event.pressed)
if (shift_esc_shift_mask) { {
if (shift_esc_shift_mask)
{
add_key(KC_GRV); add_key(KC_GRV);
send_keyboard_report(); send_keyboard_report();
} else { }
else
{
add_key(KC_ESC); add_key(KC_ESC);
send_keyboard_report(); send_keyboard_report();
} }
} else { }
if (shift_esc_shift_mask) { else
{
if (shift_esc_shift_mask)
{
del_key(KC_GRV); del_key(KC_GRV);
send_keyboard_report(); send_keyboard_report();
} else { }
else
{
del_key(KC_ESC); del_key(KC_ESC);
send_keyboard_report(); send_keyboard_report();
} }

View File

@ -1,6 +1,6 @@
#include "../../config.h" #include "../../config.h"
#define KEYMAP_VANAGON(\ #define LAYOUT_VANAGON(\
K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, \ K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, \
K13, K14, K15, K16, K17, K18, K19, K20, K21, K22, K23, \ K13, K14, K15, K16, K17, K18, K19, K20, K21, K22, K23, \
K24, K25, K26, K27, K28, K29, K30, K31, K32, K33, K34, \ K24, K25, K26, K27, K28, K29, K30, K31, K32, K33, K34, \

View File

@ -1,29 +1,26 @@
#include "jd40.h" #include QMK_KEYBOARD_H
#include "action_layer.h" #include "action_layer.h"
enum { enum
{
_BL = 0, _BL = 0,
_AL1, _AL1,
_AL2, _AL2,
}; };
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_BL] = KEYMAP_VANAGON( [_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, 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), 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, 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) MO(_AL2), KC_LCTL, KC_LALT, KC_LGUI, KC_ENT, KC_SPC, KC_RGUI, KC_RALT, KC_RSPC, MO(_AL2)),
), [_AL1] = LAYOUT_VANAGON(
[_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_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_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_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 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
), [_AL2] = LAYOUT_VANAGON(
[_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_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_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_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 KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS)};
)
};

60
keyboards/jd45/info.json Normal file
View File

@ -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 }
]
}
}
}

View File

@ -5,7 +5,7 @@
/* JD45 keymap definition macro /* JD45 keymap definition macro
*/ */
#define KEYMAP( \ #define LAYOUT( \
K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, K13, \ 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, \ K14, K15, K16, K17, K18, K19, K20, K21, K22, K23, K24, K25, \
K26, K27, K28, K29, K30, K31, K32, K33, K34, K35, K36, K37, \ K26, K27, K28, K29, K30, K31, K32, K33, K34, K35, K36, K37, \

View File

@ -3,7 +3,7 @@
/** /**
*JD45 keymap definition macro *JD45 keymap definition macro
*/ */
#define KEYMAP_JD45( \ #define LAYOUT_JD45( \
K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, K13, \ 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, \ K14, K15, K16, K17, K18, K19, K20, K21, K22, K23, K24, K25, \
K26, K27, K28, K29, K30, K31, K32, K33, K34, K35, K36, K37, \ K26, K27, K28, K29, K30, K31, K32, K33, K34, K35, K36, K37, \

View File

@ -1,4 +1,4 @@
#include "jd45.h" #include QMK_KEYBOARD_H
extern keymap_config_t keymap_config; extern keymap_config_t keymap_config;
@ -19,13 +19,15 @@ extern keymap_config_t keymap_config;
// TODO: (bdietz) - make a symbol layer for greek symbols // TODO: (bdietz) - make a symbol layer for greek symbols
// Keycodes // Keycodes
enum planck_keycodes { enum planck_keycodes
{
QWERTY = SAFE_RANGE, QWERTY = SAFE_RANGE,
LOWER, LOWER,
RAISE, RAISE,
}; };
enum macro_keycodes { enum macro_keycodes
{
KC_ALT_TAB, KC_ALT_TAB,
KC_CMD_TAB, KC_CMD_TAB,
KC_CTL_TAB, KC_CTL_TAB,
@ -99,19 +101,19 @@ enum macro_keycodes {
* `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------'
*/ */
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QWERTY] = KEYMAP_JD45( [_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), 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, 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 , 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 , _______ , _______ , _______), _______, _______, _______, LOWER, TGL_VIM, TGL_MOUSE, RAISE, _______, _______, _______),
/*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ /*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/
// TODO: (bdietz) - update the keymap documentation to include the modifier keys on the third row // TODO: (bdietz) - update the keymap documentation to include the modifier keys on the third row
/* Lower /* Lower
* ,---------+------+------+------+------+------+------+------+------+------+------+------+------. * ,---------+------+------+------+------+------+------+------+------+------+------+------+------.
* | ` | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | Bksp | * | ` | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | Bksp |
* |---------`------`------`------`------`------`------`------`------`------`------`------`------| * |---------`------`------`------`------`------`------`------`------`------`------`------`------|
@ -122,18 +124,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | | Prev | Next | Mute | * | | | | | | | | Prev | Next | Mute |
* `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------'
*/ */
[_LOWER] = KEYMAP_JD45( [_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_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_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_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), _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_MUTE),
/*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ /*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/
/* Raise /* Raise
* ,---------+------+------+------+------+------+------+------+------+------+------+------+------. * ,---------+------+------+------+------+------+------+------+------+------+------+------+------.
* | ~ | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | Bksp | * | ~ | 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 | * | | | | | | | | Prev | Next | Mute |
* `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------'
*/ */
[_RAISE] = KEYMAP_JD45( [_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_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_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_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), _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_MUTE),
/*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ /*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/
/* Mouse Layer /* Mouse Layer
* ,---------+------+------+------+------+------+------+------+------+------+------+------+------. * ,---------+------+------+------+------+------+------+------+------+------+------+------+------.
* | | |ACCL0 | | | | |WHL_L | Up |WHL_R | BTN2 | | | * | | |ACCL0 | | | | |WHL_L | Up |WHL_R | BTN2 | | |
* |---------`------`------`------`------`------`------`------`------`------`------`------`------| * |---------`------`------`------`------`------`------`------`------`------`------`------`------|
@ -167,18 +169,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------'
*/ */
[_MOUSECURSOR] = KEYMAP_JD45( [_MOUSECURSOR] = LAYOUT_JD45(
/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ /*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/
_______,_______, _______, KC_MS_U, _______, _______, _______, KC_ACL2, KC_ACL1, KC_ACL0, _______, _______, _______, _______, _______, _______, KC_MS_U, _______, _______, _______, KC_ACL2, KC_ACL1, KC_ACL0, _______, _______, _______,
/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ /*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/
_______ ,_______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, KC_BTN1, KC_BTN2, _______, _______, _______ , _______, _______, KC_MS_L, KC_MS_D, KC_MS_R, _______, _______, KC_BTN1, KC_BTN2, _______, _______, _______,
/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ /*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/
_______ ,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ /*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/
_______ , _______, _______, _______, _______, _______, _______, _______, _______, _______), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______),
/*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ /*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/
/* Adjust (Lower + Raise) /* Adjust (Lower + Raise)
* ,---------+------+------+------+------+------+------+------+------+------+------+------+------. * ,---------+------+------+------+------+------+------+------+------+------+------+------+------.
* | | | | | | | | | | | | | Del | * | | | | | | | | | | | | | Del |
* |---------`------`------`------`------`------`------`------`------`------`------`------`------| * |---------`------`------`------`------`------`------`------`------`------`------`------`------|
@ -189,19 +191,19 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | | | | Reset | * | | | | | | | | | | Reset |
* `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------'
*/ */
[_ADJUST] = KEYMAP_JD45( [_ADJUST] = LAYOUT_JD45(
/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ /*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/
_______,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL,
/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ /*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/
_______ ,_______, _______, _______, _______, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______ , _______, _______, _______, _______, _______, AG_NORM, AG_SWAP, QWERTY, _______, _______, _______, _______,
/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ /*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/
_______ ,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ /*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/
_______ , _______, _______, _______, _______ , _______ , _______, _______, _______, RESET), _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET),
/*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ /*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/
/* VIM /* VIM
* ,---------+------+------+------+------+------+------+------+------+------+------+------+------. * ,---------+------+------+------+------+------+------+------+------+------+------+------+------.
* | | | | | | | | | | | | | | * | | | | | | | | | | | | | |
* |---------`------`------`------`------`------`------`------`------`------`------`------`------| * |---------`------`------`------`------`------`------`------`------`------`------`------`------|
@ -212,18 +214,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | | | | | * | | | | | | | | | | |
* `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------'
*/ */
[_VIM] = KEYMAP_JD45( [_VIM] = LAYOUT_JD45(
/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ /*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/
_______,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ /*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/
_______ ,_______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, _______ , _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT, _______, _______,
/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ /*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/
_______ ,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ /*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/
_______ , _______, _______, _______, _______ , _______ , _______, _______, _______,_______), _______, _______, _______, _______, _______, _______, _______, _______, _______, _______),
/*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ /*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/
/* Media /* Media
* ,---------+------+------+------+------+------+------+------+------+------+------+------+------. * ,---------+------+------+------+------+------+------+------+------+------+------+------+------.
* | | | | | | | | | | | | | | * | | | | | | | | | | | | | |
* |---------`------`------`------`------`------`------`------`------`------`------`------`------| * |---------`------`------`------`------`------`------`------`------`------`------`------`------|
@ -234,46 +236,56 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | | | | | * | | | | | | | | | | |
* `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------'
*/ */
[_MEDIA] = KEYMAP_JD45( [_MEDIA] = LAYOUT_JD45(
/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ /*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/
_______,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ /*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/
_______ ,_______, _______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_MUTE, _______, KC_MPLY , _______, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_MUTE, _______, KC_MPLY,
/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ /*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/
_______ ,_______, _______, _______, _______, _______, _______, KC_VOLD, KC_VOLU, _______, _______, _______ , _______, _______, _______, _______, _______, _______, _______, KC_VOLD, KC_VOLU, _______, _______, _______,
/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ /*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/
_______ , _______, _______, _______, _______ , _______ , _______, _______, _______, _______) _______, _______, _______, _______, _______, _______, _______, _______, _______, _______)
/*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ /*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/
}; };
void persistant_default_layer_set(uint16_t default_layer) { void persistant_default_layer_set(uint16_t default_layer)
{
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }
bool process_record_user(uint16_t keycode, keyrecord_t *record) { bool process_record_user(uint16_t keycode, keyrecord_t *record)
switch (keycode) { {
switch (keycode)
{
case QWERTY: case QWERTY:
if (record->event.pressed) { if (record->event.pressed)
default_layer_set(1UL<<_QWERTY); {
default_layer_set(1UL << _QWERTY);
} }
return false; return false;
break; break;
case LOWER: case LOWER:
if (record->event.pressed) { if (record->event.pressed)
{
layer_on(_LOWER); layer_on(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST); update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else { }
else
{
layer_off(_LOWER); layer_off(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST); update_tri_layer(_LOWER, _RAISE, _ADJUST);
} }
return false; return false;
break; break;
case RAISE: case RAISE:
if (record->event.pressed) { if (record->event.pressed)
{
layer_on(_RAISE); layer_on(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST); update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else { }
else
{
layer_off(_RAISE); layer_off(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST); update_tri_layer(_LOWER, _RAISE, _ADJUST);
} }
@ -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) const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{ {
if (!eeconfig_is_enabled()) { if (!eeconfig_is_enabled())
{
eeconfig_init(); 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: // Compare to MAGIC_SWAP_ALT_GUI and MAGIC_UNSWAP_ALT_GUI configs, set in:
// quantum/quantum.c // quantum/quantum.c
if(keymap_config.swap_lalt_lgui == 1 && keymap_config.swap_ralt_rgui == 1) { if (keymap_config.swap_lalt_lgui == 1 && keymap_config.swap_ralt_rgui == 1)
{
use_cmd = false; // ... or, Alt-Tab, Ctrl-C, Ctrl-V, etc. use_cmd = false; // ... or, Alt-Tab, Ctrl-C, Ctrl-V, etc.
} }
switch (id) { switch (id)
{
case KC_ALT_TAB: case KC_ALT_TAB:
if(use_cmd) { return (record->event.pressed ? MACRO( D(LALT), D(TAB), END ) : MACRO( U(TAB), END )); } if (use_cmd)
else { return (record->event.pressed ? MACRO( D(LGUI), D(TAB), END ) : MACRO( U(TAB), END )); } {
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: case KC_CMD_TAB:
if(use_cmd) { return (record->event.pressed ? MACRO( D(LGUI), D(TAB), END ) : MACRO( U(TAB), END )); } if (use_cmd)
else { return (record->event.pressed ? MACRO( D(LALT), D(TAB), END ) : MACRO( U(TAB), END )); } {
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: case KC_CTL_TAB:
return (record->event.pressed ? MACRO( D(LCTRL), D(TAB), END ) : MACRO( U(TAB), END )); return (record->event.pressed ? MACRO(D(LCTRL), D(TAB), END) : MACRO(U(TAB), END));
case KC_CMD_SLSH: case KC_CMD_SLSH:
return (record->event.pressed ? MACRO( D(LGUI), D(SLSH),END ) : MACRO( U(SLSH),END )); return (record->event.pressed ? MACRO(D(LGUI), D(SLSH), END) : MACRO(U(SLSH), END));
case KC_AG_FIND: case KC_AG_FIND:
return use_cmd ? MACRODOWN( D(LGUI), T(F), END ) : MACRODOWN( D(LCTRL), T(F), END ); return use_cmd ? MACRODOWN(D(LGUI), T(F), END) : MACRODOWN(D(LCTRL), T(F), END);
case KC_AG_AGAIN: case KC_AG_AGAIN:
return use_cmd ? MACRODOWN( D(LGUI), T(G), END ) : MACRODOWN( D(LCTRL), T(G), END ); return use_cmd ? MACRODOWN(D(LGUI), T(G), END) : MACRODOWN(D(LCTRL), T(G), END);
case KC_AG_UNDO: case KC_AG_UNDO:
return use_cmd ? MACRODOWN( D(LGUI), T(Z), END ) : MACRODOWN( D(LCTRL), T(Z), END ); return use_cmd ? MACRODOWN(D(LGUI), T(Z), END) : MACRODOWN(D(LCTRL), T(Z), END);
case KC_AG_CUT: case KC_AG_CUT:
return use_cmd ? MACRODOWN( D(LGUI), T(X), END ) : MACRODOWN( D(LCTRL), T(X), END ); return use_cmd ? MACRODOWN(D(LGUI), T(X), END) : MACRODOWN(D(LCTRL), T(X), END);
case KC_AG_COPY: case KC_AG_COPY:
return use_cmd ? MACRODOWN( D(LGUI), T(C), END ) : MACRODOWN( D(LCTRL), T(C), END ); return use_cmd ? MACRODOWN(D(LGUI), T(C), END) : MACRODOWN(D(LCTRL), T(C), END);
case KC_AG_PASTE: case KC_AG_PASTE:
return use_cmd ? MACRODOWN( D(LGUI), T(V), END ) : MACRODOWN( D(LCTRL), T(V), END ); return use_cmd ? MACRODOWN(D(LGUI), T(V), END) : MACRODOWN(D(LCTRL), T(V), END);
case KC_AG_DESK_L: case KC_AG_DESK_L:
return use_cmd ? MACRODOWN( D(LGUI), D(LCTRL), T(SCLN), END ) : MACRODOWN( D(LALT), D(LCTRL), T(SCLN), END ); return use_cmd ? MACRODOWN(D(LGUI), D(LCTRL), T(SCLN), END) : MACRODOWN(D(LALT), D(LCTRL), T(SCLN), END);
case KC_AG_DESK_R: case KC_AG_DESK_R:
return use_cmd ? MACRODOWN( D(LGUI), D(LCTRL), T(QUOT), END ) : MACRODOWN( D(LALT), D(LCTRL), T(QUOT), END ); return use_cmd ? MACRODOWN(D(LGUI), D(LCTRL), T(QUOT), END) : MACRODOWN(D(LALT), D(LCTRL), T(QUOT), END);
case KC_AG_TAB_C: case KC_AG_TAB_C:
return use_cmd ? MACRODOWN( D(LGUI), T(W), END ) : MACRODOWN( D(LCTRL), T(W), END ); return use_cmd ? MACRODOWN(D(LGUI), T(W), END) : MACRODOWN(D(LCTRL), T(W), END);
case KC_AG_TAB_N: case KC_AG_TAB_N:
return use_cmd ? MACRODOWN( D(LGUI), T(T), END ) : MACRODOWN( D(LCTRL), T(T), END ); return use_cmd ? MACRODOWN(D(LGUI), T(T), END) : MACRODOWN(D(LCTRL), T(T), END);
case KC_AG_TAB_R: 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 use_cmd ? MACRODOWN(D(LGUI), D(LSHIFT), T(T), END) : MACRODOWN(D(LCTRL), D(LSHIFT), T(T), END);
} }
return MACRO_NONE; return MACRO_NONE;

View File

@ -1,15 +1,15 @@
#include "jd45.h" #include QMK_KEYBOARD_H
/* this keymap is to provide a basic keyboard layout for testing the matrix /* 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 * for more practical and complicated keymap refer to other keymaps in the same folder
*/ */
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = KEYMAP( [0] = LAYOUT(
ESC, Q, W, E, R, T, Y, U, I, O, P, QUOT, BSPC, 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, TAB, A, S, D, F, G, H, J, K, L, SCLN, ENT,
LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT, LSFT, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT,
PAUSE, LCTL, LALT, DEL, SPC, DEL, LEFT, UP, DOWN, RIGHT ), PAUSE, LCTL, LALT, DEL, SPC, DEL, LEFT, UP, DOWN, RIGHT),
}; };
const uint16_t PROGMEM fn_actions[] = { const uint16_t PROGMEM fn_actions[] = {

View File

@ -3,7 +3,7 @@
/** /**
*JD45 keymap definition macro *JD45 keymap definition macro
*/ */
#define KEYMAP_JD45( \ #define LAYOUT_JD45( \
K01, K02, K03, K04, K05, K06, K07, K08, K09, K10, K11, K12, K13, \ 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, \ K14, K15, K16, K17, K18, K19, K20, K21, K22, K23, K24, K25, \
K26, K27, K28, K29, K30, K31, K32, K33, K34, K35, K36, K37, \ K26, K27, K28, K29, K30, K31, K32, K33, K34, K35, K36, K37, \

View File

@ -1,4 +1,4 @@
#include "jd45.h" #include QMK_KEYBOARD_H
extern keymap_config_t keymap_config; extern keymap_config_t keymap_config;
@ -17,7 +17,8 @@ extern keymap_config_t keymap_config;
#define _ADJUST 16 #define _ADJUST 16
// Keycodes // Keycodes
enum planck_keycodes { enum planck_keycodes
{
QWERTY = SAFE_RANGE, QWERTY = SAFE_RANGE,
COLEMAK, COLEMAK,
DVORAK, DVORAK,
@ -28,7 +29,8 @@ enum planck_keycodes {
EXT_PLV EXT_PLV
}; };
enum macro_keycodes { enum macro_keycodes
{
KC_ALT_TAB, KC_ALT_TAB,
KC_CMD_TAB, KC_CMD_TAB,
KC_CTL_TAB, KC_CTL_TAB,
@ -89,18 +91,18 @@ enum macro_keycodes {
*/ */
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QWERTY] = KEYMAP_JD45( [_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, 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 , 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_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), 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 | * |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 | * | RGUI | Alt | GUI | Lower | TC/Space | TC/Space | Raise | Vol- | Vol+ | Play |
* `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------'
*/ */
[_COLEMAK] = KEYMAP_JD45( [_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, 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 , 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_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), 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 | * |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 | * | RGUI | Alt | GUI | Lower | TC/Space | TC/Space | Raise | Vol- | Vol+ | Play |
* `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------'
*/ */
[_DVORAK] = KEYMAP_JD45( [_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, 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 , 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_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), KC_RGUI, KC_LALT, KC_LGUI, LOWER, LT_TC, LT_TC, RAISE, KC_VOLD, KC_VOLU, KC_MPLY),
/*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ /*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/
/* Lower /* Lower
* ,---------+------+------+------+------+------+------+------+------+------+------+------+------. * ,---------+------+------+------+------+------+------+------+------+------+------+------+------.
* | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | Bksp | * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp | Bksp |
* |---------`------`------`------`------`------`------`------`------`------`------`------`------| * |---------`------`------`------`------`------`------`------`------`------`------`------`------|
@ -155,18 +157,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | Brite | | | | | | | Prev | Next | Mute | * | Brite | | | | | | | Prev | Next | Mute |
* `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------'
*/ */
[_LOWER] = KEYMAP_JD45( [_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_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_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 , 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), BACKLIT, _______, _______, _______, _______, _______, _______, KC_MPRV, KC_MNXT, KC_MUTE),
/*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ /*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/
/* Raise /* Raise
* ,---------+------+------+------+------+------+------+------+------+------+------+------+------. * ,---------+------+------+------+------+------+------+------+------+------+------+------+------.
* | 0 | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp | Bksp | * | 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 | * | Brite | | | | | | | Prev | Next | Mute |
* `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------'
*/ */
[_RAISE] = KEYMAP_JD45( [_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_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_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 , 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), 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 | | | * | 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. * seem to work on Mac. Presumably they'll work under Windows.
*/ */
[_TOUCHCURSOR] = KEYMAP_JD45( [_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, _______, _______, 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 , _______, 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, _______ , _______, 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 | | | * | | |ACCL0 | | | | |WHL_L | Up |WHL_R | BTN2 | | |
* |---------`------`------`------`------`------`------`------`------`------`------`------`------| * |---------`------`------`------`------`------`------`------`------`------`------`------`------|
@ -226,18 +228,18 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------'
*/ */
[_MOUSECURSOR] = KEYMAP_JD45( [_MOUSECURSOR] = LAYOUT_JD45(
/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ /*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/
_______,_______, KC_ACL0, _______, _______, _______, _______, KC_WH_L, KC_MS_U, KC_WH_R, KC_BTN2, _______, _______, _______, _______, 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_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, _______ , _______, _______, _______, _______, 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( [_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 , KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1, KC_1,
/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ /*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/
XXXXXXX , KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC , XXXXXXX, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_LBRC,
/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ /*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/
XXXXXXX , KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT , XXXXXXX, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ /*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/
EXT_PLV , XXXXXXX, KC_C, KC_V, XXXXXXX , XXXXXXX , KC_N, KC_M, XXXXXXX, XXXXXXX), EXT_PLV, XXXXXXX, KC_C, KC_V, XXXXXXX, XXXXXXX, KC_N, KC_M, XXXXXXX, XXXXXXX),
/*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ /*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/
/* Adjust (Lower + Raise) /* Adjust (Lower + Raise)
* ,---------+------+------+------+------+------+------+------+------+------+------+------+------. * ,---------+------+------+------+------+------+------+------+------+------+------+------+------.
* | | | | | | | | | | | | | Del | * | | | | | | | | | | | | | Del |
* |---------`------`------`------`------`------`------`------`------`------`------`------`------| * |---------`------`------`------`------`------`------`------`------`------`------`------`------|
@ -271,81 +273,98 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
* | | | | | | | | | | Reset | * | | | | | | | | | | Reset |
* `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------' * `-------+-------+-------+-------+---^^^----+---^^^----+---------+--------+--------+----------'
*/ */
[_ADJUST] = KEYMAP_JD45( [_ADJUST] = LAYOUT_JD45(
/*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/ /*,--------+-------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------+--------.*/
_______,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL,
/*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/ /*|--------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------`--------|*/
_______ ,_______, _______, _______, _______, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______ , _______, _______, _______, _______, _______, AG_NORM, AG_SWAP, QWERTY, COLEMAK, DVORAK, PLOVER, _______,
/*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/ /*|---------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`----------------|*/
_______ ,_______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______ , _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
/*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/ /*|----------`-------`--------`--------`--------`--------`--------`--------`--------`--------`--------`---------------|*/
_______ , _______, _______, _______, _______ , _______ , _______, _______, _______, RESET) _______, _______, _______, _______, _______, _______, _______, _______, _______, RESET)
/*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/ /*`----------+-----------+-----------+-----------+----^^^----+----^^^----+-----------+-----------+-----------+--------'*/
}; };
void persistent_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer)
{
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }
bool process_record_user(uint16_t keycode, keyrecord_t *record) { bool process_record_user(uint16_t keycode, keyrecord_t *record)
switch (keycode) { {
switch (keycode)
{
case QWERTY: case QWERTY:
if (record->event.pressed) { if (record->event.pressed)
default_layer_set(1UL<<_QWERTY); {
default_layer_set(1UL << _QWERTY);
} }
return false; return false;
break; break;
case COLEMAK: case COLEMAK:
if (record->event.pressed) { if (record->event.pressed)
default_layer_set(1UL<<_COLEMAK); {
default_layer_set(1UL << _COLEMAK);
} }
return false; return false;
break; break;
case DVORAK: case DVORAK:
if (record->event.pressed) { if (record->event.pressed)
default_layer_set(1UL<<_DVORAK); {
default_layer_set(1UL << _DVORAK);
} }
return false; return false;
break; break;
case LOWER: case LOWER:
if (record->event.pressed) { if (record->event.pressed)
{
layer_on(_LOWER); layer_on(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST); update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else { }
else
{
layer_off(_LOWER); layer_off(_LOWER);
update_tri_layer(_LOWER, _RAISE, _ADJUST); update_tri_layer(_LOWER, _RAISE, _ADJUST);
} }
return false; return false;
break; break;
case RAISE: case RAISE:
if (record->event.pressed) { if (record->event.pressed)
{
layer_on(_RAISE); layer_on(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST); update_tri_layer(_LOWER, _RAISE, _ADJUST);
} else { }
else
{
layer_off(_RAISE); layer_off(_RAISE);
update_tri_layer(_LOWER, _RAISE, _ADJUST); update_tri_layer(_LOWER, _RAISE, _ADJUST);
} }
return false; return false;
break; break;
case BACKLIT: case BACKLIT:
if (record->event.pressed) { if (record->event.pressed)
{
register_code(KC_RSFT); register_code(KC_RSFT);
#ifdef BACKLIGHT_ENABLE #ifdef BACKLIGHT_ENABLE
backlight_step(); backlight_step();
#endif #endif
} else { }
else
{
unregister_code(KC_RSFT); unregister_code(KC_RSFT);
} }
return false; return false;
break; break;
case PLOVER: case PLOVER:
if (record->event.pressed) { if (record->event.pressed)
{
layer_off(_RAISE); layer_off(_RAISE);
layer_off(_LOWER); layer_off(_LOWER);
layer_off(_ADJUST); layer_off(_ADJUST);
layer_on(_PLOVER); layer_on(_PLOVER);
if (!eeconfig_is_enabled()) { if (!eeconfig_is_enabled())
{
eeconfig_init(); eeconfig_init();
} }
keymap_config.raw = eeconfig_read_keymap(); keymap_config.raw = eeconfig_read_keymap();
@ -355,7 +374,8 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return false; return false;
break; break;
case EXT_PLV: case EXT_PLV:
if (record->event.pressed) { if (record->event.pressed)
{
layer_off(_PLOVER); layer_off(_PLOVER);
} }
return false; return false;
@ -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) const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{ {
if (!eeconfig_is_enabled()) { if (!eeconfig_is_enabled())
{
eeconfig_init(); 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: // Compare to MAGIC_SWAP_ALT_GUI and MAGIC_UNSWAP_ALT_GUI configs, set in:
// quantum/quantum.c // quantum/quantum.c
if(keymap_config.swap_lalt_lgui == 1 && keymap_config.swap_ralt_rgui == 1) { if (keymap_config.swap_lalt_lgui == 1 && keymap_config.swap_ralt_rgui == 1)
{
use_cmd = false; // ... or, Alt-Tab, Ctrl-C, Ctrl-V, etc. use_cmd = false; // ... or, Alt-Tab, Ctrl-C, Ctrl-V, etc.
} }
switch (id) { switch (id)
{
case KC_ALT_TAB: case KC_ALT_TAB:
if(use_cmd) { return (record->event.pressed ? MACRO( D(LALT), D(TAB), END ) : MACRO( U(TAB), END )); } if (use_cmd)
else { return (record->event.pressed ? MACRO( D(LGUI), D(TAB), END ) : MACRO( U(TAB), END )); } {
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: case KC_CMD_TAB:
if(use_cmd) { return (record->event.pressed ? MACRO( D(LGUI), D(TAB), END ) : MACRO( U(TAB), END )); } if (use_cmd)
else { return (record->event.pressed ? MACRO( D(LALT), D(TAB), END ) : MACRO( U(TAB), END )); } {
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: case KC_CTL_TAB:
return (record->event.pressed ? MACRO( D(LCTRL), D(TAB), END ) : MACRO( U(TAB), END )); return (record->event.pressed ? MACRO(D(LCTRL), D(TAB), END) : MACRO(U(TAB), END));
case KC_CMD_SLSH: case KC_CMD_SLSH:
return (record->event.pressed ? MACRO( D(LGUI), D(SLSH),END ) : MACRO( U(SLSH),END )); return (record->event.pressed ? MACRO(D(LGUI), D(SLSH), END) : MACRO(U(SLSH), END));
case KC_AG_FIND: case KC_AG_FIND:
return use_cmd ? MACRODOWN( D(LGUI), T(F), END ) : MACRODOWN( D(LCTRL), T(F), END ); return use_cmd ? MACRODOWN(D(LGUI), T(F), END) : MACRODOWN(D(LCTRL), T(F), END);
case KC_AG_AGAIN: case KC_AG_AGAIN:
return use_cmd ? MACRODOWN( D(LGUI), T(G), END ) : MACRODOWN( D(LCTRL), T(G), END ); return use_cmd ? MACRODOWN(D(LGUI), T(G), END) : MACRODOWN(D(LCTRL), T(G), END);
case KC_AG_UNDO: case KC_AG_UNDO:
return use_cmd ? MACRODOWN( D(LGUI), T(Z), END ) : MACRODOWN( D(LCTRL), T(Z), END ); return use_cmd ? MACRODOWN(D(LGUI), T(Z), END) : MACRODOWN(D(LCTRL), T(Z), END);
case KC_AG_CUT: case KC_AG_CUT:
return use_cmd ? MACRODOWN( D(LGUI), T(X), END ) : MACRODOWN( D(LCTRL), T(X), END ); return use_cmd ? MACRODOWN(D(LGUI), T(X), END) : MACRODOWN(D(LCTRL), T(X), END);
case KC_AG_COPY: case KC_AG_COPY:
return use_cmd ? MACRODOWN( D(LGUI), T(C), END ) : MACRODOWN( D(LCTRL), T(C), END ); return use_cmd ? MACRODOWN(D(LGUI), T(C), END) : MACRODOWN(D(LCTRL), T(C), END);
case KC_AG_PASTE: case KC_AG_PASTE:
return use_cmd ? MACRODOWN( D(LGUI), T(V), END ) : MACRODOWN( D(LCTRL), T(V), END ); return use_cmd ? MACRODOWN(D(LGUI), T(V), END) : MACRODOWN(D(LCTRL), T(V), END);
case KC_AG_DESK_L: case KC_AG_DESK_L:
return use_cmd ? MACRODOWN( D(LGUI), D(LCTRL), T(SCLN), END ) : MACRODOWN( D(LALT), D(LCTRL), T(SCLN), END ); return use_cmd ? MACRODOWN(D(LGUI), D(LCTRL), T(SCLN), END) : MACRODOWN(D(LALT), D(LCTRL), T(SCLN), END);
case KC_AG_DESK_R: case KC_AG_DESK_R:
return use_cmd ? MACRODOWN( D(LGUI), D(LCTRL), T(QUOT), END ) : MACRODOWN( D(LALT), D(LCTRL), T(QUOT), END ); return use_cmd ? MACRODOWN(D(LGUI), D(LCTRL), T(QUOT), END) : MACRODOWN(D(LALT), D(LCTRL), T(QUOT), END);
case KC_AG_TAB_C: case KC_AG_TAB_C:
return use_cmd ? MACRODOWN( D(LGUI), T(W), END ) : MACRODOWN( D(LCTRL), T(W), END ); return use_cmd ? MACRODOWN(D(LGUI), T(W), END) : MACRODOWN(D(LCTRL), T(W), END);
case KC_AG_TAB_N: case KC_AG_TAB_N:
return use_cmd ? MACRODOWN( D(LGUI), T(T), END ) : MACRODOWN( D(LCTRL), T(T), END ); return use_cmd ? MACRODOWN(D(LGUI), T(T), END) : MACRODOWN(D(LCTRL), T(T), END);
case KC_AG_TAB_R: 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 use_cmd ? MACRODOWN(D(LGUI), D(LSHIFT), T(T), END) : MACRODOWN(D(LCTRL), D(LSHIFT), T(T), END);
} }
return MACRO_NONE; return MACRO_NONE;

View File

@ -1,34 +1,35 @@
#include "jd45.h" #include QMK_KEYBOARD_H
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = KEYMAP( [0] = LAYOUT(
ESC, Q, W, F, P, G, J, L, U, Y, SCLN, QUOT, BSPC, 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, FN8, A, R, S, T, D, H, N, E, I, O, ENT,
LSFT, Z, X, C, V, B, K, M, COMM, DOT, SLSH, FN6, LSFT, Z, X, C, V, B, K, M, COMM, DOT, SLSH, FN6,
FN4, LGUI, FN7, FN2, FN1, SPC, FN5, RALT, FN3, FN0 ), FN4, LGUI, FN7, FN2, FN1, SPC, FN5, RALT, FN3, FN0),
[1] = KEYMAP( [1] = LAYOUT(
TRNS, FN10, FN11, FN12, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, UP, DEL, 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, HOME, PGUP, LEFT, RGHT,
TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, END, PGDN, DOWN, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, END, PGDN, DOWN, TRNS,
TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS ), TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS),
[2] = KEYMAP( [2] = LAYOUT(
TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, 7, 8, 9, 0, TRNS, TRNS, 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, LBRC, 4, 5, 6, DOT, TRNS,
TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, RBRC, 1, 2, 3, BSLS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, RBRC, 1, 2, 3, BSLS, TRNS,
TRNS,FN29, TRNS, TRNS, TRNS, PAUSE, EQL, MINS, TRNS, TRNS ), TRNS, FN29, TRNS, TRNS, TRNS, PAUSE, EQL, MINS, TRNS, TRNS),
[3] = KEYMAP( [3] = LAYOUT(
TRNS, F1, F2, F3, F4, F5, F6, F7, F8, F9, F10, F11, F12, 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, 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( [4] = LAYOUT(
TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, 7, 8, 9, 0, TRNS, TRNS, 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, LBRC, 4, 5, 6, DOT, TRNS,
TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, RBRC, 1, 2, 3, BSLS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, TRNS, RBRC, 1, 2, 3, BSLS, TRNS,
TRNS,FN29, TRNS, TRNS, TRNS, PAUSE, EQL, MINS, TRNS, TRNS ), TRNS, FN29, TRNS, TRNS, TRNS, PAUSE, EQL, MINS, TRNS, TRNS),
}; };
enum macro_id { enum macro_id
{
PSWD1, PSWD1,
PSWD2, PSWD2,
PSWD3, PSWD3,
@ -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) const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{ {
switch (id) { switch (id)
{
case PSWD1: case PSWD1:
return (record->event.pressed ? 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);
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: case PSWD2:
return (record->event.pressed ? 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);
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: case PSWD3:
return (record->event.pressed ? 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);
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: //case VOLUP:
// return (record->event.pressed ? // return (record->event.pressed ?
// MACRO( D(VOLU), U(VOLU), END ) : // MACRO( D(VOLU), U(VOLU), END ) :

View File

@ -1,33 +1,34 @@
#include "jd45.h" #include QMK_KEYBOARD_H
/* Mike's Layout for JD45 with backlight LEDs acting as layer indicator /* Mike's Layout for JD45 with backlight LEDs acting as layer indicator
*/ */
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = KEYMAP( [0] = LAYOUT(
TAB, Q, W, E, R, T, Y, U, I, O, P, MINS, BSLS, 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, FN1, A, S, D, F, G, H, J, K, L, QUOT, ENT,
FN0, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT, FN0, Z, X, C, V, B, N, M, COMM, DOT, SLSH, RSFT,
NO, LCTL, LALT, LGUI, SPC, BSPC, APP, FN2, ESC, NO ), NO, LCTL, LALT, LGUI, SPC, BSPC, APP, FN2, ESC, NO),
[1] = KEYMAP( [1] = LAYOUT(
GRV, TRNS, UP, TRNS, 7, 8, 9, 0, MINS, EQL, PSCR, LBRC, RBRC, 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, 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, TRNS, 1, 2, 3, DEL, END, PGDN, TRNS, TRNS,
TRNS, TRNS, TRNS, SPC, TRNS, DEL, TRNS, FN3, TRNS, TRNS ), TRNS, TRNS, TRNS, SPC, TRNS, DEL, TRNS, FN3, TRNS, TRNS),
[2] = KEYMAP( [2] = LAYOUT(
TRNS, TRNS, VOLU, TRNS, F7, F8, F9, F10, F11, F12, PSCR, FN3, FN4, 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, 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, TRNS, F1, F2, F3, MUTE, MPRV, MNXT, MSTP, TRNS,
TRNS, TRNS, TRNS, LGUI, TRNS, TRNS, TRNS, TRNS, PAUS, TRNS ) TRNS, TRNS, TRNS, LGUI, TRNS, TRNS, TRNS, TRNS, PAUS, TRNS)
/* , /* ,
[3] = KEYMAP( [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, 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, BTLD, 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 macro_id { enum macro_id
{
M_LAYER1, M_LAYER1,
M_LAYER2 M_LAYER2
}; };
@ -38,13 +39,13 @@ const uint16_t PROGMEM fn_actions[] = {
[1] = ACTION_MACRO(M_LAYER1), [1] = ACTION_MACRO(M_LAYER1),
[2] = ACTION_LAYER_TAP_TOGGLE(2), [2] = ACTION_LAYER_TAP_TOGGLE(2),
[3] = ACTION_BACKLIGHT_STEP(), [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) const macro_t *action_get_macro(keyrecord_t *record, uint8_t id, uint8_t opt)
{ {
// MACRODOWN only works in this function // MACRODOWN only works in this function
switch(id) { switch (id)
{
case M_LAYER1: case M_LAYER1:
// need to add a timer for doubletap: https://github.com/jackhumbert/qmk_firmware/wiki#timer-functionality // need to add a timer for doubletap: https://github.com/jackhumbert/qmk_firmware/wiki#timer-functionality
// action_function_tap may also handle this... // action_function_tap may also handle this...

View File

@ -1,4 +1,4 @@
#include "jd45.h" #include QMK_KEYBOARD_H
enum jd45_layers enum jd45_layers
{ {
@ -37,46 +37,13 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
{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}, {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)}, {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)}, {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) } {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)}},
[_QWERTYNUMMODS] = { [_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__}},
{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}, [_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__}},
{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)}, [_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__}},
{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)}, [_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__}},
{XXXXXXX, KC_LALT, KC_LGUI, XXXXXXX, XXXXXXX, XXXXXXX, F_NUMSPC, XXXXXXX, XXXXXXX, MO(_FKEYNUMPAD), MO(_ADJUST) } [_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__}}};
},
[_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[] = { const uint16_t PROGMEM fn_actions[] = {
[0] = ACTION_LAYER_TAP_KEY(_NUMSYM, KC_SPC), [0] = ACTION_LAYER_TAP_KEY(_NUMSYM, KC_SPC),
@ -84,24 +51,29 @@ const uint16_t PROGMEM fn_actions[] = {
[2] = ACTION_LAYER_TAP_KEY(_FUNCTION, KC_TAB), [2] = ACTION_LAYER_TAP_KEY(_FUNCTION, KC_TAB),
}; };
void persistent_default_layer_set(uint16_t default_layer) { void persistent_default_layer_set(uint16_t default_layer)
{
eeconfig_update_default_layer(default_layer); eeconfig_update_default_layer(default_layer);
default_layer_set(default_layer); default_layer_set(default_layer);
} }
static bool singular_key = false; static bool singular_key = false;
bool process_record_user(uint16_t keycode, keyrecord_t *record) { bool process_record_user(uint16_t keycode, keyrecord_t *record)
{
uint16_t macro_kc = (keycode == MO(_ADJUST) ? DYN_REC_STOP : keycode); uint16_t macro_kc = (keycode == MO(_ADJUST) ? DYN_REC_STOP : keycode);
if (!process_record_dynamic_macro(macro_kc, record)) { if (!process_record_dynamic_macro(macro_kc, record))
{
return false; return false;
} }
println(" "); println(" ");
print("process record"); print("process record");
switch (keycode) { switch (keycode)
{
case MACSLEEP: case MACSLEEP:
if (record->event.pressed) { if (record->event.pressed)
{
// ACTION_MODS_KEY(MOD_LCTL | MOD_LSFT, KC_POWER); // ACTION_MODS_KEY(MOD_LCTL | MOD_LSFT, KC_POWER);
register_code(KC_RSFT); register_code(KC_RSFT);
register_code(KC_RCTL); register_code(KC_RCTL);
@ -113,21 +85,23 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return false; return false;
break; break;
case USEFNMODS: case USEFNMODS:
if (record->event.pressed) { if (record->event.pressed)
persistent_default_layer_set(1UL<<_QWERTY); {
#ifdef AUDIO_ENABLE persistent_default_layer_set(1UL << _QWERTY);
#ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_fnpc, false, 0); PLAY_NOTE_ARRAY(tone_fnpc, false, 0);
#endif #endif
print("Space-FN"); print("Space-FN");
} }
return false; return false;
break; break;
case USENUMMODS: case USENUMMODS:
if (record->event.pressed) { if (record->event.pressed)
persistent_default_layer_set(1UL<<_QWERTYNUMMODS); {
#ifdef AUDIO_ENABLE persistent_default_layer_set(1UL << _QWERTYNUMMODS);
#ifdef AUDIO_ENABLE
PLAY_NOTE_ARRAY(tone_fnmac, false, 0); PLAY_NOTE_ARRAY(tone_fnmac, false, 0);
#endif #endif
print("Space-Numpad"); print("Space-Numpad");
} }
return false; return false;
@ -140,10 +114,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
return true; return true;
}; };
void matrix_init_user(void)
void matrix_init_user(void) { {
#ifdef AUDIO_ENABLE #ifdef AUDIO_ENABLE
startup_user(); startup_user();
#endif #endif
// debug_enable = true; // debug_enable = true;
} }