#include QMK_KEYBOARD_H
#include "milestogo.h"
#define LAYOUT_wrap_m2primee(...) LAYOUT_m2primee(__VA_ARGS__)
#define LAYOUT_wrap_m2primee_trns(...) LAYOUT_m2primee_trns(__VA_ARGS__)
#define LAYOUT_m2primee(\
K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, \
K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K112,\
K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, \
K300, K301, K303, K304, K306, K308, K311, K312, \
K413, K414 )\
{\
{K000, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, KC_NO, KC_NO},\
{K100, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, KC_NO, K112, KC_NO, KC_NO},\
{K200, K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211, K212, KC_NO, KC_NO}, \
{K300, K301, KC_NO, K303, K304, KC_NO, K306, KC_NO, K308, KC_NO, KC_NO, K311, K312, KC_NO, KC_NO}, \
{KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, K413, K414 } \
}
#define LAYOUT_m2primee_trns(\
K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, \
K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, K112, \
K201, K202, K203, K204, K205, K206, K207, K208, K209, K210, K211) \
{\
{KC_TRNS, K001, K002, K003, K004, K005, K006, K007, K008, K009, K010, K011, K012, KC_NO, KC_NO}, \
{KC_TRNS, K101, K102, K103, K104, K105, K106, K107, K108, K109, K110, KC_NO, K112, KC_NO, KC_NO}, \
{KC_LSFT, K201, K202, K203, K204, K205, KC_TRNS, K207, K208, K209, K210, K211, KC_TRNS, KC_NO, KC_NO}, \
{KC_LALT, KC_TRNS, KC_NO, KC_TRNS, KC_TRNS, KC_NO, KC_TRNS, KC_NO, KC_TRNS, KC_NO, KC_NO, KC_TRNS, KC_RSFT, KC_NO, KC_NO}, \
{KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, KC_NO, B_1ME, KC_ENTER } \
}
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[_QWERTY] = LAYOUT_wrap_m2primee(\
KC_TAB, _________________QWERTY_L1_________________, _________________QWERTY_R1_________________, KC_MINS, KC_EQL,
LT(_MOV,KC_ESC), _________________QWERTY_L2_________________, _________________QWERTY_R2_________________, KC_QUOT,
KC_LSFT, _________________QWERTY_L3_________________, MO(_SYM), _________________QWERTY_R3_________________, KC_RSFT,
B_2ME, KC_LALT, LT(_NUM, KC_DEL), KC_BSPC, KC_SPC, LT(_NUM, KC_ESC), B_2ME, KC_RALT,
B_1ME, KC_ENTER),
[_NUM] = LAYOUT_wrap_m2primee(\
KC_TRNS, __________40_______NUM_L1__________________, __________40_______NUM_R1__________________, KC_VOLD, KC_VOLU,
KC_TRNS, __________40_______NUM_L2__________________, __________40_______NUM_R2__________________, KC_ENT,
KC_TRNS, __________40_______NUM_L3__________________, KC_TRNS, __________40_______NUM_R3__________________, KC_TRNS,
KC_TRNS, KC_TRNS, KC_LSFT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS,
KC_TRNS, KC_TRNS),
[_CDH] = LAYOUT_wrap_m2primee_trns(\
______________COLEMAK_MOD_DH_L1____________, ______________COLEMAK_MOD_DH_R1____________, KC_TRNS, KC_TRNS,
______________COLEMAK_MOD_DH_L2____________, ______________COLEMAK_MOD_DH_R2____________, KC_QUOT,
______________COLEMAK_MOD_DH_L3____________, KC_TRNS, ______________COLEMAK_MOD_DH_R3____________),
[_SYM] = LAYOUT_wrap_m2primee_trns(\
___________________SYM_L1__________________, ___________________SYM_R1__________________, KC_TRNS, KC_TRNS,
___________________SYM_L2__________________, ___________________SYM_R2__________________, KC_TRNS,
___________________SYM_L3__________________, KC_TRNS, ___________________SYM_R3__________________),
[_MOV] = LAYOUT_wrap_m2primee_trns(\
__________40_______MOV_L1__________________, __________40_______MOV_R1__________________, KC_TRNS, KC_CDH,
__________40_______MOV_L2__________________, __________40_______MOV_R2__________________, KC_TRNS,
__________40_______MOV_L3__________________, KC_TRNS, __________40_______MOV_R3__________________),
[_DMOV] = LAYOUT_wrap_m2primee_trns(\
____________40__DELMOV_L1__________________, ____________40__DELMOV_R1__________________ , KC_TRNS, KC_CDH,
____________40__DELMOV_L2__________________, ____________40__DELMOV_R2__________________ , KC_TRNS,
____________40__DELMOV_L3__________________, KC_TRNS, ____________40__DELMOV_R3__________________ ),
};
void matrix_init_user(void) {
setPinOutput(B1);
writePinHigh(B1);
setPinOutput(B2);
writePinLow(B2);
setPinOutput(B3);
writePinLow(B3);
backlight_enable();
backlight_level(2);
}
bool led_update_kb(led_t led_state) {
#ifndef USE_BABBLEPASTE
writePin(B1, led_state.caps_lock);
writePin(B2, led_state.num_lock);
writePin(B3, led_state.scroll_lock);
#endif
return true;
}
void babble_modeswitch_kb(uint8_t mode) {
#ifdef USE_BABBLEPASTE
switch (mode) {
case (BABL_READMUX_MODE):
writePinHigh(B3);
writePinLow(B2);
backlight_level(1);
break;
case (BABL_LINUX_MODE):
writePinHigh(B2);
writePinLow(B3);
backlight_level(2);
break;
case (BABL_MAC_MODE): writePinLow(B3);
writePinLow(B2);
backlight_level(4);
break;
}
babble_modeswitch_user(mode);
#endif
}
layer_state_t layer_state_set_user(layer_state_t state) {
writePin(B1, layer_state_cmp(state, _CDH));
return state;
}