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.

74 lines
2.4 KiB

  1. /* Copyright 2021 Aquacylinder
  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 custom_keycodes {
  18. MACRO1 = SAFE_RANGE, //MACRO1 can be anything you want see the qmk documentation
  19. MACRO2, //MACRO2 Same thing, you can add as many as you like
  20. };
  21. const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
  22. //Macro's are mentioned here allong with the keycodes
  23. LAYOUT_ortho_5x4( //Base layer (0)
  24. TG(1), KC_VOLD, KC_VOLU, KC_BSPC,
  25. KC_P7, KC_P8, KC_P9, KC_PAST,
  26. KC_P4, KC_P5, KC_P6, KC_PSLS,
  27. KC_P1, KC_P2, KC_P3, KC_PPLS,
  28. KC_P0, KC_PDOT, KC_PENT, KC_PMNS),
  29. LAYOUT_ortho_5x4( //Layer 1
  30. KC_TRNS, KC_TRNS, KC_TRNS, KC_CALC,
  31. KC_MPRV, KC_MSTP, KC_MPLY, KC_MNXT,
  32. KC_NO, KC_NO, KC_NO, KC_NO,
  33. KC_NO, KC_NO, KC_UP, KC_NO,
  34. MO(2), KC_LEFT, KC_DOWN, KC_RGHT),
  35. LAYOUT_ortho_5x4( //Layer 2
  36. KC_NO, KC_NO, KC_NO, KC_NO,
  37. KC_NO, KC_NO, KC_NO, RESET,
  38. KC_NO, KC_NO, KC_NO, KC_NO,
  39. KC_NO, KC_NO, KC_NO, KC_NO,
  40. KC_TRNS, KC_NLCK, KC_NO, KC_NO),
  41. //Copy any layer and edit it for more layers, be sure to add a key to go to that layer
  42. };
  43. bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  44. switch (keycode) {
  45. case MACRO1: //This is where the macro's are located
  46. if (record->event.pressed) {
  47. // when keycode MACRO1 is pressed
  48. SEND_STRING("Thank you");
  49. } else {
  50. // when keycode MACRO1 is released
  51. SEND_STRING("for being you <3");
  52. }
  53. break;
  54. case MACRO2:
  55. if (record->event.pressed) {
  56. // when keycode MACRO2 is pressed
  57. SEND_STRING("Pizza is");
  58. } else {
  59. // when keycode MACRO2 is released
  60. SEND_STRING("delicious ;)");
  61. }
  62. break;
  63. }
  64. return true;
  65. }