process_records.c 1.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051
  1. /*
  2. Copyright 2018-2022 Eric Gebhart <e.a.gebhart@gmail.com>
  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. This program is distributed in the hope that it will be useful,
  8. but WITHOUT ANY WARRANTY; without even the implied warranty of
  9. MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
  10. GNU General Public License for more details.
  11. You should have received a copy of the GNU General Public License
  12. along with this program. If not, see <http://www.gnu.org/licenses/>.
  13. */
  14. #include "ericgebhart.h"
  15. #include "extensions.h"
  16. __attribute__((weak)) bool process_record_keymap(uint16_t keycode, keyrecord_t *record) { return true; }
  17. __attribute__((weak)) bool process_record_secrets(uint16_t keycode, keyrecord_t *record) { return true; }
  18. // Defines actions for my global custom keycodes. Defined in ericgebhart.h file
  19. // Then runs the _keymap's record handier if not processed here
  20. bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  21. #ifdef OLED_CUSTOM_ENABLE
  22. process_record_user_oled(keycode, record);
  23. #endif
  24. PROCESS_EXTENSIONS
  25. if (process_record_keymap(keycode, record) && process_record_secrets(keycode, record)) {
  26. switch (keycode) {
  27. case KC_RESET:
  28. if (!record->event.pressed) {
  29. reset_keyboard();
  30. }
  31. return false;
  32. break;
  33. case KC_SPACETEST: // test something.
  34. // default_layer_set(1UL << _BEAKL);
  35. // tap_code16(LSFT(KC_SPACE));
  36. break;
  37. }
  38. }
  39. return true;
  40. }