124 lines
8 KiB
C
124 lines
8 KiB
C
#include QMK_KEYBOARD_H
|
|
#include "version.h"
|
|
|
|
// START-MUGUR-REGION
|
|
|
|
#include QMK_KEYBOARD_H
|
|
#include "version.h"
|
|
|
|
/* Macros */
|
|
enum custom_keycodes {EPRM = SAFE_RANGE, MACRO_15, MACRO_14, MACRO_13, MACRO_12, MACRO_11, MACRO_10, MACRO_9, MACRO_8, MACRO_7, MACRO_6, MACRO_5, MACRO_4, MACRO_3, MACRO_2, MACRO_1};
|
|
|
|
bool process_record_user(uint16_t keycode, keyrecord_t *record) {
|
|
if (record->event.pressed) {
|
|
switch (keycode) {
|
|
case MACRO_1: SEND_STRING(SS_LCTL(SS_TAP(X_X)) SS_TAP(X_0)); return false;
|
|
case MACRO_2: SEND_STRING(SS_LCTL(SS_TAP(X_X)) SS_TAP(X_2)); return false;
|
|
case MACRO_3: SEND_STRING(SS_LCTL(SS_TAP(X_X)) SS_TAP(X_3)); return false;
|
|
case MACRO_4: SEND_STRING(SS_LCTL(SS_TAP(X_X)) SS_TAP(X_4) SS_TAP(X_T)); return false;
|
|
case MACRO_5: SEND_STRING(SS_LALT(SS_TAP(X_X)) "gtd" SS_TAP(X_ENTER)); return false;
|
|
case MACRO_6: SEND_STRING(SS_LCTL(SS_TAP(X_X)) SS_TAP(X_B)); return false;
|
|
case MACRO_7: SEND_STRING("λ"); return false;
|
|
case MACRO_8: SEND_STRING(SS_LALT(SS_TAP(X_X)) "magit" SS_TAP(X_ENTER)); return false;
|
|
case MACRO_9: SEND_STRING(SS_RGUI(SS_TAP(X_I)) SS_TAP(X_E)); return false;
|
|
case MACRO_10: SEND_STRING(SS_LCTL(SS_TAP(X_X)) SS_TAP(X_8)); return false;
|
|
case MACRO_11: SEND_STRING(SS_RGUI(SS_TAP(X_I)) SS_TAP(X_O)); return false;
|
|
case MACRO_12: SEND_STRING(SS_RGUI(SS_TAP(X_I)) SS_TAP(X_L)); return false;
|
|
case MACRO_13: SEND_STRING(SS_RGUI(SS_TAP(X_M)) SS_TAP(X_S)); return false;
|
|
case MACRO_14: SEND_STRING(SS_RGUI(SS_TAP(X_D))); return false;
|
|
case MACRO_15: SEND_STRING(SS_RGUI(SS_TAP(X_M)) SS_TAP(X_ENTER)); return false;
|
|
}
|
|
}
|
|
return true;
|
|
};
|
|
|
|
/* Tap Dances */
|
|
|
|
|
|
/* Leader Keys */
|
|
|
|
|
|
/* Combos */
|
|
|
|
|
|
/* Layer Codes and Matrix */
|
|
enum layer_codes {BASE, NUMERIC, MOVE, EMACS, HYPM, QMIK};
|
|
|
|
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
|
|
|
|
[BASE] = LAYOUT_split_3x6_3(KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPACE, KC_LCTL, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCOLON, LT(MOVE, KC_QUOTE), KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMMA, KC_DOT, KC_QUESTION, MO(QMIK), MO(EMACS), KC_LAPO, MT(MOD_LGUI, KC_SPACE), KC_ENTER, KC_RAPC, TG(NUMERIC)),
|
|
|
|
[NUMERIC] = LAYOUT_split_3x6_3(KC_TILDE, KC_EXCLAIM, KC_AT, KC_HASH, KC_DOLLAR, KC_PERCENT, KC_CIRCUMFLEX, KC_AMPERSAND, KC_ASTERISK, KC_MINUS, KC_EQUAL, KC_BSPACE, KC_0, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, LT(MOVE, KC_ENTER), KC_LSFT, KC_TRNS, KC_LEFT_ANGLE_BRACKET, KC_LEFT_CURLY_BRACE, KC_LBRACKET, KC_LEFT_PAREN, KC_RIGHT_PAREN, KC_RBRACKET, KC_RIGHT_CURLY_BRACE, KC_RIGHT_ANGLE_BRACKET, KC_PIPE, MO(EMACS), TG(QMIK), LCTL(KC_LALT), KC_TRNS, KC_TRNS, KC_LSFT, TG(NUMERIC)),
|
|
|
|
[MOVE] = LAYOUT_split_3x6_3(KC_TRNS, LALT(KC_V), KC_UP, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, LCTL(KC_A), KC_LEFT, KC_DOWN, KC_RIGHT, LCTL(KC_E), KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, LALT(KC_LEFT_ANGLE_BRACKET), LCTL(KC_V), LALT(KC_RIGHT_ANGLE_BRACKET), 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),
|
|
|
|
[EMACS] = LAYOUT_split_3x6_3(KC_ESCAPE, KC_TRNS, KC_TRNS, MACRO_1, MACRO_2, MACRO_3, MACRO_4, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, LALT(KC_PERCENT), KC_TRNS, KC_TRNS, MACRO_5, MACRO_6, KC_TRNS, KC_TRNS, MACRO_7, KC_TRNS, KC_TRNS, RESET, KC_TRNS, LALT(KC_X), LCTL(KC_C), KC_TRNS, KC_LEFT_PAREN, KC_RIGHT_PAREN, MACRO_8, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MACRO_9, MACRO_10, KC_TRNS, MO(HYPM)),
|
|
|
|
[HYPM] = LAYOUT_split_3x6_3(KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MACRO_15, MACRO_11, MACRO_12, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, MACRO_14, 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_M, MACRO_13, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS),
|
|
|
|
[QMIK] = LAYOUT_split_3x6_3(KC_TRNS, RGB_TOG, RGB_MOD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RESET, RGB_SAD, RGB_VAD, RGB_HUD, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, RGB_SAI, RGB_VAI, RGB_HUI, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_LSFT, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS, KC_TRNS)};
|
|
|
|
// END-MUGUR-REGION
|
|
|
|
#ifdef OLED_DRIVER_ENABLE
|
|
// 'fm_logo-128x32', 32x128px
|
|
static void render_logo(void) {
|
|
static const char PROGMEM fm_logo[] = {
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
0x00, 0x00, 0x00, 0x00, 0x20, 0x70, 0x78, 0x78, 0x78, 0x78, 0x38, 0x30, 0x60, 0xd0, 0xc0, 0x80,
|
|
0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
|
|
0x83, 0xcf, 0xfe, 0xfc, 0xf0, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x06, 0x06, 0x06, 0x0c, 0x0e, 0x1e, 0x1e, 0x3e, 0x7e, 0xfe, 0xff,
|
|
0xff, 0xff, 0xff, 0xff, 0xff, 0xff, 0xfc, 0x78, 0x70, 0x70, 0x60, 0x60, 0x60, 0x60, 0x00, 0x00,
|
|
0x00, 0x00, 0x00, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0x80, 0xc0, 0xc0, 0xc0, 0xe0, 0xfb,
|
|
0xff, 0xff, 0x83, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
0x00, 0x00, 0x00, 0x01, 0x01, 0x01, 0x01, 0x03, 0x03, 0x07, 0x07, 0x0f, 0x1f, 0x7f, 0xff, 0xff,
|
|
0x7f, 0x3f, 0x3f, 0x1f, 0x1f, 0x1e, 0x1e, 0x1c, 0x1c, 0x18, 0x18, 0x18, 0x00, 0x00, 0x00, 0x00,
|
|
0x00, 0x30, 0x30, 0x60, 0x60, 0x60, 0xe0, 0xf0, 0xf0, 0xf0, 0xf0, 0xf8, 0xf8, 0xfe, 0xff, 0xf8,
|
|
0xe0, 0xe0, 0xc0, 0x80, 0x80, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x0f, 0xff, 0xff, 0xff, 0x1f, 0x0f, 0x07,
|
|
0x07, 0x07, 0x03, 0x03, 0x83, 0x83, 0x83, 0x83, 0x83, 0x80, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00,
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x03, 0x07, 0x0e, 0x1c, 0xf8,
|
|
0xfc, 0xfe, 0x6f, 0xe7, 0xf3, 0xf9, 0xf9, 0xf9, 0xf9, 0xf3, 0xe3, 0x07, 0x1e, 0xfc, 0xf0, 0x00,
|
|
0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01,
|
|
0x07, 0x0f, 0x1c, 0x38, 0x33, 0x33, 0x77, 0x77, 0x33, 0x33, 0x39, 0x1c, 0x0f, 0x07, 0x01, 0x00
|
|
};
|
|
oled_write_raw_P(fm_logo, sizeof(fm_logo));
|
|
}
|
|
|
|
// rotate the OLEDs
|
|
oled_rotation_t oled_init_user(oled_rotation_t rotation) {
|
|
if (isLeftHand) {
|
|
return OLED_ROTATION_270;
|
|
} else {
|
|
return OLED_ROTATION_90;
|
|
}
|
|
}
|
|
|
|
void oled_task_user(void) {
|
|
render_logo();
|
|
oled_scroll_set_speed(5);
|
|
oled_scroll_left();
|
|
}
|
|
#endif
|
|
|
|
void keyboard_post_init_user(void) {
|
|
debug_enable=true;
|
|
//debug_matrix=true;
|
|
debug_keyboard=true;
|
|
//debug_mouse=true;
|
|
}
|