You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

159 lines
5.9 KiB

  1. // this is the style you want to emulate.
  2. // This is the canonical layout file for the Quantum project. If you want to add another keyboard,
  3. #include QMK_KEYBOARD_H
  4. // Each layer gets a name for readability, which is then used in the keymap matrix below.
  5. // The underscores don't mean anything - you can have a layer called STUFF or any other name.
  6. // Layer names don't all need to be of the same length, obviously, and you can also skip them
  7. // entirely and just use numbers.
  8. enum chimera_ergo_layers
  9. {
  10. _QWERTY,
  11. _CAPS,
  12. _NUMPAD,
  13. _SYMBOLS,
  14. _MACROS,
  15. _NAV
  16. };
  17. enum custom_keycodes {
  18. SC_INCL = SAFE_RANGE,
  19. SC_PULL,
  20. SC_PUSH,
  21. SC_SCAP,
  22. SC_SCOF
  23. };
  24. #define SC_NMPD TG(_NUMPAD)
  25. #define SC_SYMB TG(_SYMBOLS)
  26. #define SC_SPFN LT(_NAV,KC_EQL)
  27. #define SC_SCTL MT(MOD_LCTL, KC_LBRC)
  28. #define SC_SCTR MT(MOD_LCTL, KC_RBRC)
  29. #define SC_SPLT MT(MOD_LALT, KC_MINS)
  30. #define SC_SPRT MT(MOD_LALT, KC_1)
  31. #define SC_GBRC MT(MOD_RGUI, KC_RBRC)
  32. #define SC_MESC LT(_MACROS, KC_ESC)
  33. #define SC_CAD LALT(LCTL(KC_DEL))
  34. #define LONGPRESS_DELAY 150
  35. //#define LAYER_TOGGLE_DELAY 300
  36. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  37. [_QWERTY] = LAYOUT(
  38. KC_LBRC, KC_1, SC_SCTL, SC_SPLT, SC_SPFN, KC_5, KC_6, SC_GBRC, SC_SPRT, SC_SCTR, KC_0, KC_RBRC,
  39. SC_MESC, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_QUOT,
  40. KC_TAB, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_ENT,
  41. KC_LSPO, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_RSPC,
  42. SC_NMPD, KC_BSPC, KC_SPC, SC_SYMB
  43. ),
  44. [_CAPS] = LAYOUT(
  45. _______, KC_UNDS, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
  46. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
  47. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_COLN, _______,
  48. SC_SCOF, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, SC_SCOF,
  49. _______, _______, _______, _______
  50. ),
  51. [_NUMPAD] = LAYOUT(
  52. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_MINS, _______,
  53. _______, _______, KC_COLN, _______, _______, _______, _______, KC_7, KC_8, KC_9, KC_ASTR, _______,
  54. _______, _______, KC_DOT , _______, _______, _______, _______, KC_4, KC_5, KC_6, KC_PLUS, _______,
  55. _______, _______, _______, _______, _______, _______, _______, KC_1, KC_2, KC_3, KC_SLSH, _______,
  56. _______, _______, _______, KC_0
  57. ),
  58. [_SYMBOLS] = LAYOUT(
  59. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
  60. _______, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSLS,
  61. KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_TILD, KC_EQL, KC_UNDS, KC_LCBR, KC_RCBR, _______,
  62. KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_GRV, KC_PLUS, KC_MINS, KC_LBRC, KC_RBRC, _______,
  63. KC_PIPE, _______, _______, _______
  64. ),
  65. [_MACROS] = LAYOUT(
  66. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
  67. _______, _______, _______, _______, _______, _______, _______, _______, SC_INCL, _______, _______, _______,
  68. _______, _______, _______, SC_CAD, _______, _______, _______, _______, _______, _______, _______, _______,
  69. SC_SCAP, _______, _______, _______, _______, _______, _______, _______, SC_PULL, SC_PUSH, _______, _______,
  70. _______, _______, _______, _______
  71. ),
  72. [_NAV] = LAYOUT(
  73. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
  74. _______, _______, _______, _______, _______, _______, _______, KC_PGUP, KC_UP, KC_PGDN, KC_PSCR, _______,
  75. _______, _______, _______, _______, _______, _______, _______, KC_LEFT, KC_DOWN, KC_RGHT, _______, _______,
  76. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
  77. _______, KC_DEL, _______, _______
  78. ),
  79. };
  80. bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  81. switch(keycode) {
  82. /* include some kind of library or header */
  83. case SC_INCL:
  84. if (record->event.pressed) {
  85. SEND_STRING("#include <>");
  86. tap_code(KC_LEFT);
  87. }
  88. return false;
  89. case SC_PULL:
  90. if (record->event.pressed) {
  91. SEND_STRING("git pull");
  92. tap_code(KC_ENT);
  93. }
  94. return false;
  95. case SC_PUSH:
  96. if (record->event.pressed) {
  97. SEND_STRING("git push");
  98. tap_code(KC_ENT);
  99. }
  100. return false;
  101. case SC_SCAP:
  102. if (record->event.pressed) {
  103. layer_on(_CAPS);
  104. tap_code(KC_CAPS);
  105. }
  106. return false;
  107. case SC_SCOF:
  108. if (record->event.pressed) {
  109. layer_off(_CAPS);
  110. tap_code(KC_CAPS);
  111. }
  112. return false;
  113. default:
  114. return true;
  115. }
  116. return true;
  117. };
  118. void matrix_scan_user(void) {
  119. uint8_t layer = biton32(layer_state);
  120. switch (layer) {
  121. case _QWERTY:
  122. set_led_green;
  123. break;
  124. case _CAPS:
  125. set_led_white;
  126. break;
  127. case _NUMPAD:
  128. set_led_blue;
  129. break;
  130. case _SYMBOLS:
  131. set_led_red;
  132. break;
  133. case _NAV:
  134. set_led_magenta;
  135. break;
  136. case _MACROS:
  137. set_led_cyan;
  138. break;
  139. default:
  140. set_led_green;
  141. break;
  142. }
  143. };