keymap.c 10 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287
  1. #include QMK_KEYBOARD_H
  2. extern keymap_config_t keymap_config;
  3. enum custom_layers {
  4. _QWERTY,
  5. _LOWER,
  6. _RAISE,
  7. _EMOJI,
  8. };
  9. enum custom_keycodes {
  10. QWERTY = SAFE_RANGE,
  11. LOWER,
  12. RAISE,
  13. EMOJI,
  14. ABOVE,
  15. BUG,
  16. CONFUSED,
  17. CRY,
  18. CLAP,
  19. FLIP,
  20. FNGLEFT,
  21. FNGRIGHT,
  22. FROWN,
  23. GRIN,
  24. HEART,
  25. JOY,
  26. LLAP,
  27. ROFL,
  28. SHIT,
  29. SING,
  30. SHRUG,
  31. THINK,
  32. THMBDN,
  33. THMBUP,
  34. TOUNGE,
  35. WINK
  36. };
  37. #define KC_X0 MT(MOD_LCTL, KC_ESC) // Hold for Left Ctrl, Tap for GraveESC
  38. #define KC_X1 MT(MOD_RSFT, KC_ENT) // Hold for Right Shift, Tap for Enter
  39. #define KC_X2 MT(MOD_RSFT, LGUI(KC_ENT)) // Send Command Enter
  40. #define KC_BACK LGUI(KC_LBRC) // Back
  41. #define KC_FORWARD LGUI(KC_RBRC) // Forward
  42. #define KC_EMOJ TT(_EMOJI) // Hold for Emoji Layer, or tap 5 times.
  43. #define KC_QS LGUI(KC_SPC) // Send Command + Space (for QuickSilver).
  44. #define KC_WTAB LGUI(KC_TILD) // Send Command + ~ (for window changing).
  45. #define KC_TABR LGUI(KC_RCBR) // Send Command + } (for tab changing).
  46. #define KC_TABL LGUI(KC_LCBR) // Send Command + { (for tab changing).
  47. #define HYPR_0 HYPR(KC_TILD) // Send Hyper + ~.
  48. #define HYPR_1 HYPR(KC_EXLM) // Send Hyper + !.
  49. #define HYPR_2 HYPR(KC_AT) // Send Hyper + @.
  50. // Fillers to make layering more clear
  51. #define _______ KC_TRNS
  52. #define XXXXXXX KC_NO
  53. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  54. /* Qwerty
  55. * ,-----------------------------------------------------------------------------------.
  56. * | Esc | Q | W | E | R | T | Y | U | I | O | P | Bksp |
  57. * |------+------+------+------+------+-------------+------+------+------+------+------|
  58. * | Tab | A | S | D | F | G | H | J | K | L | ; | ' |
  59. * |------+------+------+------+------+------|------+------+------+------+------+------|
  60. * | Shift| Z | X | C | V | B | N | M | , | . | / |Enter |
  61. * |------+------+------+------+------+------+------+------+------+------+------+------|
  62. * |Emoji | Ctrl | Alt |Lower | Cmd |Space |Space |Raise | Left | Down | Up |Right |
  63. * `-----------------------------------------------------------------------------------'
  64. */
  65. [_QWERTY] = LAYOUT_ortho_4x12(
  66. KC_TAB, KC_Q, KC_W, KC_E, KC_R, KC_T, KC_Y, KC_U, KC_I, KC_O, KC_P, KC_BSPC,
  67. KC_X0, KC_A, KC_S, KC_D, KC_F, KC_G, KC_H, KC_J, KC_K, KC_L, KC_SCLN, KC_QUOT,
  68. KC_LSFT, KC_Z, KC_X, KC_C, KC_V, KC_B, KC_N, KC_M, KC_COMM, KC_DOT, KC_SLSH, KC_X1,
  69. KC_EMOJ, KC_LCTL, KC_LALT, KC_LGUI, MO(_LOWER), KC_SPC, KC_SPC, MO(_RAISE), KC_LEFT, KC_DOWN, KC_UP, KC_RIGHT
  70. ),
  71. /* Lower
  72. * ,-----------------------------------------------------------------------------------.
  73. * | ~ | ! | @ | # | $ | % | ^ | & | * | ( | ) | Bksp |
  74. * |------+------+------+------+------+-------------+------+------+------+------+------|
  75. * |cmd(~)| <- | -> | TAB_L| TAB_R| F5 | F6 | _ | + | { | } | | |
  76. * |------+------+------+------+------+------|------+------+------+------+------+------|
  77. * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO ~ |ISO | | | |Enter |
  78. * |------+------+------+------+------+------+------+------+------+------+------+------|
  79. * | | | | | | | | Tab- | Vol- | Vol+ | Tab+ |
  80. * `-----------------------------------------------------------------------------------'
  81. */
  82. [_LOWER] = LAYOUT_ortho_4x12(
  83. KC_TILD, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_CIRC, KC_AMPR, KC_ASTR, KC_LPRN, KC_RPRN, KC_BSPC,
  84. KC_WTAB, KC_BACK, KC_FORWARD, KC_TABL, KC_TABR, KC_F5, KC_F6, KC_UNDS, KC_PLUS, KC_LCBR, KC_RCBR, KC_PIPE,
  85. KC_LSFT, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, S(KC_NUHS), S(KC_NUBS), _______, _______, _______,
  86. _______, _______, _______, _______, _______, KC_QS, KC_QS, _______, _______, _______, _______, _______
  87. ),
  88. /* Raise
  89. * ,-----------------------------------------------------------------------------------.
  90. * | ` | 1 | 2 | 3 | 4 | 5 | 6 | 7 | 8 | 9 | 0 | Bksp |
  91. * |------+------+------+------+------+-------------+------+------+------+------+------|
  92. * |cmd(~)| F1 | F2 | F3 | F4 | F5 | F6 | - | = | [ | ] | \ |
  93. * |------+------+------+------+------+------|------+------+------+------+------+------|
  94. * | | F7 | F8 | F9 | F10 | F11 | F12 |ISO # |ISO / | | |Enter |
  95. * |------+------+------+------+------+------+------+------+------+------+------+------|
  96. * | | | | | | | | Home | PgUp | PgDn | End |
  97. * `-----------------------------------------------------------------------------------'
  98. */
  99. [_RAISE] = LAYOUT_ortho_4x12(
  100. KC_GRV, KC_1, KC_2, KC_3, KC_4, KC_5, KC_6, KC_7, KC_8, KC_9, KC_0, KC_BSPC,
  101. KC_WTAB, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, KC_MINS, KC_EQL, KC_LBRC, KC_RBRC, KC_BSLS,
  102. KC_LSFT, KC_F7, KC_F8, KC_F9, KC_F10, KC_F11, KC_F12, KC_NUHS, KC_NUBS, _______, _______, KC_X2,
  103. _______, _______, _______, _______, _______, _______, _______, _______, KC_HOME, KC_PGDN, KC_PGUP, KC_END
  104. ),
  105. /* Emoji Layer
  106. * ┌─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┬─────┐
  107. * │HYPR0│ Q │ ;-) │ E │ 🤣 │ :-P │ Y │ U │:'-( │FLIP │ P │ │
  108. * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
  109. * │HYPR1│ 👆 │SHRUG│ GRIN│ :-( │ G │ <3 │ :-) │ k │LLAP │ ; │ │
  110. * ├─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┼─────┤
  111. * │HYPR2│🎶^🎶│💭^💭│ 👏 | :-\ │ 🐛 │ n │ :-D │ SHIT│ . │ / │ │
  112. * ├─────┼─────┼─────┼─────┼─────┼─────┴─────┼─────┼─────┼─────┼─────┼─────┤
  113. * │ │ │ │ │Brig-│ Sleep │Brig+│ 👈 │ 👎 | 👍 │ 👉 │
  114. * └─────┴─────┴─────┴─────┴─────┴───────────┴─────┴─────┴─────┴─────┴─────┘
  115. */
  116. [_EMOJI] = LAYOUT_ortho_4x12(
  117. HYPR_0, _______, WINK, _______, ROFL, TOUNGE, _______, _______, CRY, FLIP, _______, _______ ,
  118. HYPR_1, ABOVE, SHRUG, GRIN, FROWN, _______, HEART, JOY, _______, LLAP, _______, _______ ,
  119. HYPR_2, SING, THINK, CLAP, CONFUSED, BUG, _______, _______, SHIT, _______, _______, _______ ,
  120. _______, _______, _______, _______, KC_SLCK, KC_SLEP, KC_SLEP, KC_PAUS, FNGLEFT, THMBDN, THMBUP, FNGRIGHT
  121. ),
  122. };
  123. #ifdef AUDIO_ENABLE
  124. float tone_qwerty[][2] = SONG(QWERTY_SOUND);
  125. float tone_dvorak[][2] = SONG(DVORAK_SOUND);
  126. float tone_colemak[][2] = SONG(COLEMAK_SOUND);
  127. #endif
  128. void persistent_default_layer_set(uint16_t default_layer) {
  129. eeconfig_update_default_layer(default_layer);
  130. default_layer_set(default_layer);
  131. }
  132. bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  133. switch (keycode) {
  134. case ABOVE:
  135. if (record->event.pressed) {
  136. SEND_STRING("&above; ");
  137. }
  138. return false;
  139. break;
  140. case BUG:
  141. if (record->event.pressed) {
  142. SEND_STRING("&bug;");
  143. }
  144. return false;
  145. break;
  146. case CONFUSED:
  147. if (record->event.pressed) {
  148. SEND_STRING(":-\\");
  149. }
  150. return false;
  151. break;
  152. case CRY:
  153. if (record->event.pressed) {
  154. SEND_STRING(":'-( ");
  155. }
  156. return false;
  157. break;
  158. case CLAP:
  159. if (record->event.pressed) {
  160. SEND_STRING("&clap; ");
  161. }
  162. return false;
  163. break;
  164. case FLIP:
  165. if (record->event.pressed) {
  166. SEND_STRING("&fliptable;");
  167. }
  168. return false;
  169. break;
  170. case FNGLEFT:
  171. if (record->event.pressed) {
  172. SEND_STRING("&fingerleft; ");
  173. }
  174. return false;
  175. break;
  176. case FNGRIGHT:
  177. if (record->event.pressed) {
  178. SEND_STRING("&fingerright; ");
  179. }
  180. return false;
  181. break;
  182. case FROWN:
  183. if (record->event.pressed) {
  184. SEND_STRING(":-( ");
  185. }
  186. return false;
  187. break;
  188. case GRIN:
  189. if (record->event.pressed) {
  190. SEND_STRING(":-D ");
  191. }
  192. return false;
  193. break;
  194. case HEART:
  195. if (record->event.pressed) {
  196. SEND_STRING("<3 ");
  197. }
  198. return false;
  199. break;
  200. case JOY:
  201. if (record->event.pressed) {
  202. SEND_STRING(":-) ");
  203. }
  204. return false;
  205. break;
  206. case LLAP:
  207. if (record->event.pressed) {
  208. SEND_STRING("&llap; ");
  209. }
  210. return false;
  211. break;
  212. case ROFL:
  213. if (record->event.pressed) {
  214. SEND_STRING("&rofl; ");
  215. }
  216. return false;
  217. break;
  218. case SHIT:
  219. if (record->event.pressed) {
  220. SEND_STRING("&shit; ");
  221. }
  222. return false;
  223. break;
  224. case SING:
  225. if (record->event.pressed) {
  226. SEND_STRING("_sing_");
  227. }
  228. return false;
  229. break;
  230. case SHRUG:
  231. if (record->event.pressed) {
  232. SEND_STRING("&shrug; ");
  233. }
  234. return false;
  235. break;
  236. case THINK:
  237. if (record->event.pressed) {
  238. SEND_STRING("_think_");
  239. }
  240. return false;
  241. break;
  242. case THMBDN:
  243. if (record->event.pressed) {
  244. SEND_STRING("&thumbdown; ");
  245. }
  246. return false;
  247. break;
  248. case THMBUP:
  249. if (record->event.pressed) {
  250. SEND_STRING("&thumbup; ");
  251. }
  252. return false;
  253. break;
  254. case TOUNGE:
  255. if (record->event.pressed) {
  256. SEND_STRING(":-P ");
  257. }
  258. return false;
  259. break;
  260. case WINK:
  261. if (record->event.pressed) {
  262. SEND_STRING(";-) ");
  263. }
  264. return false;
  265. break;
  266. }
  267. return true;
  268. }
  269. void matrix_scan_user(void) {
  270. return;
  271. };