This commit is contained in:
Cadey Ratio 2020-11-16 08:49:31 -05:00
parent a0917658ca
commit 12caa9ab6c
3 changed files with 67 additions and 13 deletions

View File

@ -8,7 +8,6 @@
| P A | Proxy Ashe | Proxytag for Ashe |
| P S | Proxy Sephie | Proxytag for Sephie |
| P M | Proxy Mai | Proxytag for Mai |
| G I E | Go If Err | Inserts an `if err != nil` sequence |
| G B | Go Build | `go build` |
| G B A | Go Build All | `go build ./...` |
| G T | Go Test | `go test` |

View File

@ -61,6 +61,13 @@ enum custom_keycodes {
ST_MACRO_34,
PRINT_WPM,
IF_ERR_NIL,
RUST_ATTRIBUTE,
RUST_TEST,
RUST_DERIVE,
RUST_MAP_ERR,
RUST_PUB_CRATE,
FAT_ARROW,
THIN_ARROW,
};
#define COLEMAK 0
@ -70,14 +77,15 @@ enum custom_keycodes {
#define MEDIA 4
#define DWM 5
#define STENO 6
#define POGBAU 7
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[0] = LAYOUT_moonlander(
KC_EQUAL, KC_1, KC_2, KC_3, KC_4, KC_5, KC_LEFT, KC_RIGHT, KC_6, KC_7, KC_8, KC_9, KC_0, KC_MINUS,
KC_DELETE, KC_Q, KC_W, KC_F, KC_P, KC_G, TG(4), TG(2), KC_J, KC_L, KC_U, KC_Y, KC_SCOLON, KC_BSLASH,
KC_ESCAPE, KC_A, KC_R, KC_S, KC_T, KC_D, TG(1), MO(5), KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOTE,
KC_LSHIFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMMA, KC_DOT, KC_SLASH, KC_RSHIFT,
MO(3), KC_LCTRL, KC_LALT, KC_LEFT, KC_RIGHT, KC_LEAD, RCTL_T(KC_ESCAPE), KC_UP, KC_DOWN, KC_RGUI, KC_PSCREEN, MO(3),
KC_DELETE, KC_Q, KC_W, KC_F, KC_P, KC_G, TG(MEDIA), TG(DVORAK), KC_J, KC_L, KC_U, KC_Y, KC_SCOLON, KC_BSLASH,
KC_ESCAPE, KC_A, KC_R, KC_S, KC_T, KC_D, TG(QWERTY), MO(DWM), KC_H, KC_N, KC_E, KC_I, KC_O, KC_QUOTE,
KC_LSHIFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_K, KC_M, KC_COMMA, KC_DOT, KC_SLASH, MO(POGBAU),
MO(SYMNUM), KC_LCTRL, KC_LALT, KC_LEFT, KC_RIGHT, KC_LEAD, RCTL_T(KC_ESCAPE), KC_UP, KC_DOWN, KC_RGUI, KC_PSCREEN, MO(SYMNUM),
KC_SPACE, KC_BSPACE, KC_LGUI,
KC_COLON, KC_TAB, KC_SFTENT
),
@ -93,14 +101,14 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[2] = LAYOUT_moonlander(
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_QUOTE, KC_COMMA, KC_DOT, KC_P, KC_Y, KC_TRANSPARENT, KC_TRANSPARENT, KC_F, KC_G, KC_C, KC_R, KC_L, KC_TRANSPARENT,
KC_TRANSPARENT, KC_A, KC_O, KC_E, KC_U, KC_I, KC_TRANSPARENT, KC_TRANSPARENT, KC_D, KC_H, KC_T, KC_N, KC_S, KC_SCOLON,
KC_TRANSPARENT, KC_A, KC_O, KC_E, KC_U, KC_I, KC_TRANSPARENT, KC_TRANSPARENT, KC_D, KC_H, KC_T, KC_N, KC_S, KC_TRANSPARENT,
KC_TRANSPARENT, KC_SCOLON, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT
),
[3] = LAYOUT_moonlander(
KC_ESCAPE, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, IF_ERR_NIL, KC_GT, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
KC_ESCAPE, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_LT, KC_GT, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11,
KC_TRANSPARENT, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, DYN_REC_START1, DYN_REC_START2, KC_SCROLLLOCK, KC_7, KC_8, KC_9, KC_ASTR, KC_F12,
KC_PGUP, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_GRAVE, DYN_MACRO_PLAY1, DYN_MACRO_PLAY2,KC_NUMLOCK, KC_4, KC_5, KC_6, KC_KP_PLUS, KC_MINUS,
KC_PGDOWN, KC_PERC, KC_CIRC, KC_LBRACKET, KC_RBRACKET, KC_TILD, KC_AMPR, KC_1, KC_2, KC_3, KC_BSLASH, KC_TRANSPARENT,
@ -135,6 +143,15 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
STN_A, STN_O, STN_ST2,
STN_ST3, STN_E, STN_U
),
[POGBAU] = LAYOUT_moonlander(
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, RUST_TEST, RUST_PUB_CRATE, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, RUST_ATTRIBUTE, FAT_ARROW, THIN_ARROW, RUST_MAP_ERR, KC_UNDS, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, IF_ERR_NIL, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, RUST_DERIVE, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT,
KC_TRANSPARENT, KC_TRANSPARENT, KC_TRANSPARENT
),
};
extern bool g_suspend_state;
@ -159,6 +176,7 @@ const uint8_t PROGMEM ledmap[][DRIVER_LED_TOTAL][3] = {
[6] = { {0,205,155}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {250,159,255}, {14,222,242}, {14,222,242}, {0,0,0}, {0,0,0}, {250,159,255}, {255,220,201}, {255,220,201}, {0,0,0}, {0,0,0}, {250,159,255}, {233,218,217}, {233,218,217}, {0,0,0}, {0,0,0}, {250,159,255}, {205,255,255}, {205,255,255}, {0,0,0}, {0,0,0}, {250,159,255}, {31,255,255}, {31,255,255}, {0,0,0}, {0,0,0}, {0,0,0}, {255,220,201}, {233,218,217}, {31,255,255}, {0,0,0}, {0,0,0}, {250,159,255}, {14,222,242}, {14,222,242}, {0,0,0}, {0,0,0}, {250,159,255}, {14,222,242}, {14,222,242}, {0,0,0}, {0,0,0}, {250,159,255}, {255,220,201}, {255,220,201}, {0,0,0}, {0,0,0}, {250,159,255}, {233,218,217}, {233,218,217}, {0,0,0}, {0,0,0}, {250,159,255}, {205,255,255}, {205,255,255}, {0,0,0}, {0,0,0}, {250,159,255}, {31,255,255}, {31,255,255}, {0,0,0}, {0,0,0}, {0,0,0}, {255,220,201}, {233,218,217}, {31,255,255}, {0,0,0} },
[POGBAU] = { {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,183,238}, {0,183,238}, {0,183,238}, {0,0,0}, {0,0,0}, {0,183,238}, {0,183,238}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,183,238}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,183,238}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,183,238}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {134,142,216}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0} }
};
void set_layer_color(int layer) {
@ -202,10 +220,13 @@ void rgb_matrix_indicators_user(void) {
case 6:
set_layer_color(6);
break;
default:
if (rgb_matrix_get_flags() == LED_FLAG_NONE)
rgb_matrix_set_color_all(0, 0, 0);
break;
case 7:
set_layer_color(7);
break;
default:
if (rgb_matrix_get_flags() == LED_FLAG_NONE)
rgb_matrix_set_color_all(0, 0, 0);
break;
}
}
@ -436,7 +457,7 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
if (record->event.pressed) {
char display[20];
snprintf(display, 20, "\n%d\n", get_current_wpm());
snprintf(display, 20, "Current WPM: %d\n", get_current_wpm());
send_string((const char *)display);
}
@ -446,6 +467,41 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
SEND_STRING("if err != nil {\n\t\n}" SS_TAP(X_UP));
}
return false;
case RUST_ATTRIBUTE:
if (record->event.pressed) {
SEND_STRING("#[]" SS_TAP(X_LEFT));
}
return false;
case RUST_TEST:
if (record->event.pressed) {
SEND_STRING("#[test]");
}
return false;
case RUST_DERIVE:
if (record->event.pressed) {
SEND_STRING("#[derive()]" SS_TAP(X_LEFT) SS_TAP(X_LEFT));
}
return false;
case RUST_MAP_ERR:
if (record->event.pressed) {
SEND_STRING(".map_err()" SS_TAP(X_LEFT));
}
return false;
case RUST_PUB_CRATE:
if (record->event.pressed) {
SEND_STRING("pub (crate) ");
}
return false;
case FAT_ARROW:
if (record->event.pressed) {
SEND_STRING("=>");
}
return false;
case THIN_ARROW:
if (record->event.pressed) {
SEND_STRING("->");
}
return false;
}
return true;
}

View File

@ -30,7 +30,6 @@ void matrix_scan_user(void) {
/* SEQ_THREE_KEYS(KC_A, KC_S, KC_D) { autoshift_disable(); } */
// Go
SEQ_THREE_KEYS(KC_G, KC_I, KC_E) { SEND_STRING("if err != nil {\n\t\n}" SS_TAP(X_UP)); }
SEQ_TWO_KEYS(KC_G, KC_B) { SEND_STRING("go build" SS_TAP(X_ENTER)); }
SEQ_THREE_KEYS(KC_G, KC_B, KC_A) { SEND_STRING("go build ./..." SS_TAP(X_ENTER)); }
SEQ_TWO_KEYS(KC_G, KC_T) { SEND_STRING("go test" SS_TAP(X_ENTER)); }