keymap.c 6.9 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153
  1. /* Copyright 2020 keyboard-magpie
  2. *
  3. * This program is free software: you can redistribute it and/or modify
  4. * it under the terms of the GNU General Public License as published by
  5. * the Free Software Foundation, either version 2 of the License, or
  6. * (at your option) any later version.
  7. *
  8. * This program is distributed in the hope that it will be useful,
  9. * but WITHOUT ANY WARRANTY; without even the implied warranty of
  10. * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  11. * GNU General Public License for more details.
  12. *
  13. * You should have received a copy of the GNU General Public License
  14. * along with this program. If not, see <http://www.gnu.org/licenses/>.
  15. */
  16. #include QMK_KEYBOARD_H
  17. // Each layer gets a name for readability, which is then used in the keymap matrix below.
  18. // The underscores don't mean anything - you can have a layer called STUFF or any other name.
  19. // Layer names don't all need to be of the same length, obviously, and you can also skip them
  20. // entirely and just use numbers.
  21. enum centromere_layers
  22. {
  23. _BASE,
  24. _SYMB,
  25. _NUMB,
  26. };
  27. enum combo_events {
  28. COMBO_BSPC,
  29. COMBO_TAB,
  30. COMBO_ESC,
  31. COMBO_DEL,
  32. COMBO_UNDS,
  33. COMBO_BKSL,
  34. COMBO_LESS,
  35. COMBO_MORE,
  36. COMBO_QUOT,
  37. COMBO_DASH,
  38. };
  39. /* Combomap
  40. *
  41. * ,-----------------------------. ,--------------------------------.
  42. * | | ESC | | | | | | BSLH |
  43. * |-----+-----+-----+-----+------| |--------------------------------|
  44. * | | BSPC | | | LES | GRT | |
  45. * |-----+-----+-----+--RMB+-LMB--+ |--------------------------------|
  46. * | | MINS | | | | QUO | UNDR | | |
  47. * `------+-----+-----+------+----' `--------------------------------'
  48. * .-------------------------. .-----------------.
  49. * | | | | | | | |
  50. * '-------------------------' '-----------------'
  51. */
  52. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  53. /* Keymap 0: Basic layer
  54. *
  55. * ,-----------------------------. ,--------------------------------.
  56. * | Q | W | E | R | T | | Y | U | I | O | P |
  57. * |-----+-----+-----+-----+------| |--------------------------------|
  58. * |CTRL/A| S | D | F | G | | H | J | K | L | CTRL/; |
  59. * |-----+-----+-----+-----+------+ |--------------------------------|
  60. * |SHFT/Z| X | C | V | B | | N | M | < | > | SHFT/? |
  61. * `------+-----+-----+------+----' `--------------------------------'
  62. * .-------------------------. .-----------------.
  63. * |ESC/META|ENT/ALT|SPC(SYM)| |SPC(NUM)|BSPC|TAB|
  64. * '-------------------------' '-----------------'
  65. */
  66. [_BASE] = LAYOUT(
  67. KC_NO, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_NO,
  68. KC_NO, MT(MOD_LCTL, KC_A), KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, MT(MOD_LCTL, KC_SCLN), KC_NO,
  69. KC_NO, MT(MOD_RSFT, KC_Z), KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, MT(MOD_RSFT, KC_SLSH), KC_NO,
  70. MT(MOD_LGUI, KC_ESC), MT(MOD_LALT, KC_ENT), LT(_SYMB, KC_SPC), LT(_NUMB, KC_SPC), KC_LSFT, MT(MOD_RSFT, KC_TAB)
  71. ),
  72. /* Keymap 1: Symbols layer
  73. * ,-----------------------------. ,--------------------------------.
  74. * | ! | @ | { | } | | ` | ~ | | | \ |
  75. * |-----+-----+-----+-----+------| |--------------------------------|
  76. * | # | $ | ( | ) | LMB | | + | - | / | * | ' |
  77. * |-----+-----+-----+-----+------+ |--------------------------------|
  78. * | % | ^ | [ | ] | RMB | | & | = | , | . | - |
  79. * `------+-----+-----+------+----' `--------------------------------'
  80. * .-----------------. .------------------.
  81. * |MMB | ; | = | | = | ; | DEL |
  82. * '-----------------' '------------------'
  83. */
  84. [_SYMB] = LAYOUT(
  85. KC_NO, KC_EXLM, KC_AT, KC_LCBR, KC_RCBR, KC_PIPE, KC_GRV, KC_TILD, KC_TRNS, KC_TRNS, KC_BSLS, KC_NO,
  86. KC_NO, KC_HASH, KC_DLR, KC_LPRN, KC_RPRN, KC_BTN2, KC_PLUS, KC_MINS, KC_SLSH, KC_ASTR, KC_QUOT, KC_NO,
  87. KC_NO, KC_PERC, KC_CIRC, KC_LBRC, KC_RBRC, KC_BTN1, KC_AMPR, KC_EQL, KC_COMM, KC_DOT, KC_MINS, KC_NO,
  88. CMB_TOG, KC_SCLN, KC_EQL, KC_EQL, KC_SCLN, KC_DEL
  89. ),
  90. /* Keymap 2: Pad/Function layer
  91. * ,-----------------------------. ,-------------------------------.
  92. * | 1 | 2 | 3 | 4 | 5 | | 6 | 7 | 8 | 9 | 0 |
  93. * |-----+-----+-----+-----+------| |-------------------------------|
  94. * | F1 | F2 | F3 | F4 | F5 | | LFT | DWN | UP | RGT | VOLUP |
  95. * |-----+-----+-----+-----+------+ |-------------------------------|
  96. * | F6 | F7 | F8 | F9 | F10 | |MLFT | MDWN| MUP | MRGT| VOLDN |
  97. * `------+-----+-----+------+----' `-------------------------------'
  98. * .-----------------. .-----------------.
  99. * | F11 | F12| | | | PLY | SKP |
  100. * '-----------------' '-----------------'
  101. */
  102. [_NUMB] = LAYOUT(
  103. KC_NO, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_NO,
  104. KC_NO, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT, KC_VOLU, KC_NO,
  105. KC_NO, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KC_MS_L, KC_MS_D, KC_MS_U, KC_MS_R, KC_VOLD, KC_NO,
  106. KC_F11, KC_F12, KC_TRNS, KC_TRNS, KC_MPLY, KC_MNXT
  107. ),
  108. };
  109. // layer_state_t layer_state_set_user(layer_state_t state) {
  110. // return update_tri_layer_state(state, _LOWER, _RAISE, _ADJUST);
  111. // }
  112. #ifdef COMBO_ENABLE
  113. const uint16_t PROGMEM combo_bspc[] = {KC_S, KC_D, COMBO_END};
  114. const uint16_t PROGMEM combo_tab[] = {KC_D, KC_F, COMBO_END};
  115. const uint16_t PROGMEM combo_esc[] = {KC_W, KC_E, COMBO_END};
  116. const uint16_t PROGMEM combo_del[] = {KC_A, KC_S, COMBO_END};
  117. const uint16_t PROGMEM combo_unds[] = {KC_M, KC_COMM, COMBO_END};
  118. const uint16_t PROGMEM combo_bksl[] = {KC_O, KC_P, COMBO_END};
  119. const uint16_t PROGMEM combo_less[] = {KC_H, KC_J, COMBO_END};
  120. const uint16_t PROGMEM combo_more[] = {KC_K, KC_L, COMBO_END};
  121. const uint16_t PROGMEM combo_quot[] = {KC_N, KC_M, COMBO_END};
  122. const uint16_t PROGMEM combo_dash[] = {KC_X, KC_C, COMBO_END};
  123. combo_t key_combos[COMBO_COUNT] = {
  124. [COMBO_BSPC] = COMBO(combo_bspc,KC_BSPC),
  125. [COMBO_TAB] = COMBO(combo_tab,KC_TAB),
  126. [COMBO_ESC] = COMBO(combo_esc,KC_ESC),
  127. [COMBO_DEL] = COMBO(combo_del,KC_DEL),
  128. [COMBO_UNDS] = COMBO(combo_unds, KC_UNDS),
  129. [COMBO_BKSL] = COMBO(combo_bksl,KC_BSLS),
  130. [COMBO_LESS] = COMBO(combo_less,KC_LT),
  131. [COMBO_MORE] = COMBO(combo_more,KC_GT),
  132. [COMBO_QUOT] = COMBO(combo_quot, KC_QUOT),
  133. [COMBO_DASH] = COMBO(combo_dash, KC_MINS),
  134. };
  135. #endif