keymap.c 9.2 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195
  1. /* Copyright 2015-2017 Jack Humbert
  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. enum ortho_4x12_layers {
  18. _QWERTY,
  19. _FN,
  20. _LOWER,
  21. _RAISE,
  22. _ADJUST
  23. };
  24. enum ortho_4x12_keycodes {
  25. LOWER = SAFE_RANGE,
  26. RAISE,
  27. SHRUG, // ¯\_(ツ)_/¯
  28. TFLIP, // (╯°□°)╯︵ ┻━┻
  29. POOP, // 💩
  30. DPOINT, // (ಠ_ಠ)
  31. STRUT, // ᕕ( ᐛ )ᕗ
  32. SARCSM, // ⸮
  33. };
  34. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  35. /* Qwerty
  36. * ,-----------------------------------------------------------------------------------.
  37. * | Tab | Q | W | E | R | T | Y | U | I | O | P |Bkpsc |
  38. * |------+------+------+------+------+-------------+------+------+------+------+------|
  39. * | Esc | A | S | D | F | G | H | J | K | L | ; | " |
  40. * |------+------+------+------+------+------|------+------+------+------+------+------|
  41. * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
  42. * |------+------+------+------+------+------+------+------+------+------+------+------|
  43. * | FN | Ctrl | GUI | ALT |Lower | Space |Raise | Left | Down | Up |Right |
  44. * `-----------------------------------------------------------------------------------'
  45. */
  46. [_QWERTY] = LAYOUT_ortho_4x12(
  47. KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
  48. KC_ESC, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
  49. KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_ENT,
  50. MO(_FN), KC_LCTL, KC_LGUI, KC_LALT, LOWER, KC_SPC, KC_SPC, RAISE, KC_LEFT, KC_DOWN, KC_UP, KC_RGHT
  51. ),
  52. /* FN
  53. * ,-----------------------------------------------------------------------------------.
  54. * | ` | | | | | | | | |POOP |PrtScr|Del |
  55. * |------+------+------+------+------+-------------+------+------+------+------+------|
  56. * | | | | | | | | | | | |UC_Wnc|
  57. * |------+------+------+------+------+------|------+------+------+------+------+------|
  58. * | |SHRUG |TFLIP | POOP |DPOINT|STRUT | | | | |SARCSM|UC_Lin|
  59. * |------+------+------+------+------+------+------+------+------+------+------+------|
  60. * | | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | |
  61. * `-----------------------------------------------------------------------------------'
  62. */
  63. [_FN] = LAYOUT_ortho_4x12(
  64. KC_GRV, _______, _______, _______, _______, _______, _______, _______, _______, POOP, KC_PSCR, KC_DEL,
  65. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, UC_M_WC,
  66. _______, SHRUG, TFLIP, POOP, DPOINT, STRUT, _______, _______, _______, _______, SARCSM, UC_M_LN,
  67. _______, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, _______
  68. ),
  69. /* Lower
  70. * ,-----------------------------------------------------------------------------------.
  71. * | | | | | | | | | | | | Del |
  72. * |------+------+------+------+------+-------------+------+------+------+------+------|
  73. * | Del | F1 | F2 | F3 | F4 | F5 | F6 | _ | + | { | } | | |
  74. * |------+------+------+------+------+------|------+------+------+------+------+------|
  75. * | | F7 | F8 | F9 | F10 | F11 | F12 | | | | | |
  76. * |------+------+------+------+------+------+------+------+------+------+------+------|
  77. * | | | | | | | |Raise | Home | PgDn | PgUp | End |
  78. * `-----------------------------------------------------------------------------------'
  79. */
  80. [_LOWER] = LAYOUT_ortho_4x12(
  81. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL,
  82. KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE,
  83. _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, _______, _______, _______, _______,
  84. _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END
  85. ),
  86. /* Raise
  87. * ,-----------------------------------------------------------------------------------.
  88. * | | | | | | | | | | | | Del |
  89. * |------+------+------+------+------+-------------+------+------+------+------+------|
  90. * | Del | F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ |
  91. * |------+------+------+------+------+------|------+------+------+------+------+------|
  92. * | | F7 | F8 | F9 | F10 | F11 | F12 | | Prev | | | |
  93. * |------+------+------+------+------+------+------+------+------+------+------+------|
  94. * | | | | |Lower | | | | Next | Vol- | Vol+ | Play |
  95. * `-----------------------------------------------------------------------------------'
  96. */
  97. [_RAISE] = LAYOUT_ortho_4x12(
  98. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, KC_DEL,
  99. KC_DEL, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS,
  100. _______, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, _______, KC_MPRV, _______, _______, _______,
  101. _______, _______, _______, _______, _______, _______, _______, _______, KC_MNXT, KC_VOLD, KC_VOLU, KC_MPLY
  102. ),
  103. /* Adjust (Lower + Raise)
  104. * ,-----------------------------------------------------------------------------------.
  105. * | | Reset| Debug| | | | | | | | | Del |
  106. * |------+------+------+------+------+-------------+------+------+------+------+------|
  107. * | | | | | | | | | | | |
  108. * |------+------+------+------+------+------|------+------+------+------+------+------|
  109. * | | | | | | | | | | | |
  110. * |------+------+------+------+------+------+------+------+------+------+------+------|
  111. * | | | | | | | | | | | |
  112. * `-----------------------------------------------------------------------------------'
  113. */
  114. [_ADJUST] = LAYOUT_ortho_4x12(
  115. _______, RESET, DEBUG, _______, _______, _______, _______, TERM_ON, TERM_OFF, _______, _______, KC_DEL,
  116. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
  117. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______,
  118. _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______, _______
  119. )
  120. };
  121. bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  122. switch (keycode) {
  123. case LOWER:
  124. if (record->event.pressed) {
  125. layer_on(_LOWER);
  126. update_tri_layer(_LOWER, _RAISE, _ADJUST);
  127. } else {
  128. layer_off(_LOWER);
  129. update_tri_layer(_LOWER, _RAISE, _ADJUST);
  130. }
  131. return false;
  132. break;
  133. case RAISE:
  134. if (record->event.pressed) {
  135. layer_on(_RAISE);
  136. update_tri_layer(_LOWER, _RAISE, _ADJUST);
  137. } else {
  138. layer_off(_RAISE);
  139. update_tri_layer(_LOWER, _RAISE, _ADJUST);
  140. }
  141. return false;
  142. break;
  143. case SHRUG:
  144. if (record->event.pressed) {
  145. send_unicode_string("¯\\_(ツ)_/¯");
  146. }
  147. return false;
  148. break;
  149. case TFLIP:
  150. if (record->event.pressed) {
  151. send_unicode_string("(╯°□°)╯︵ ┻━┻");
  152. }
  153. return false;
  154. break;
  155. case POOP:
  156. if (record->event.pressed) {
  157. send_unicode_string("💩");
  158. }
  159. return false;
  160. break;
  161. case DPOINT:
  162. if (record->event.pressed) {
  163. send_unicode_string("(ಠ_ಠ)");
  164. }
  165. return false;
  166. break;
  167. case STRUT:
  168. if (record->event.pressed) {
  169. send_unicode_string("ᕕ( ᐛ )ᕗ");
  170. }
  171. return false;
  172. break;
  173. case SARCSM:
  174. if (record->event.pressed) {
  175. send_unicode_string("⸮");
  176. }
  177. return false;
  178. break;
  179. }
  180. return true;
  181. };