muppetjones.c 1.7 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152
  1. /* Copyright 2020 Stephen J. Bush @muppetjones
  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. #include "muppetjones.h"
  18. #include "tapmods.h"
  19. #include "features/casemodes.h"
  20. /* Placeholder function
  21. * If defined in a keymap.c, this will be ignored.
  22. */
  23. __attribute__((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; }
  24. /* Handle keypresses
  25. */
  26. bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  27. if (!process_case_modes(keycode, record)) {
  28. return false;
  29. }
  30. // Regular user keycode case statement
  31. switch (keycode) {
  32. case CLMK_DH:
  33. if (record->event.pressed) {
  34. set_single_persistent_default_layer(_CLMK_DH);
  35. }
  36. return false;
  37. break;
  38. case QWERTY:
  39. if (record->event.pressed) {
  40. // print("mode just switched to qwerty and this is a huge string\n");
  41. set_single_persistent_default_layer(_QWERTY);
  42. }
  43. return false;
  44. break;
  45. default:
  46. break;
  47. }
  48. return process_record_keymap(keycode, record);
  49. }