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.

48 lines
1.6 KiB

  1. /* Copyright 2021 Choi Byungyoon <byungyoonc@gmail.com>
  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 "byungyoonc.h"
  18. #if (__has_include("secrets.h") && !defined(NO_SECRETS))
  19. # include "secrets.h"
  20. #else
  21. static const char *const secrets[] = {"test1", "test2"};
  22. #endif
  23. #if !defined(MACRO_TIMER)
  24. # define MACRO_TIMER 20
  25. #endif
  26. /* replicaJunction's process_record_user_kb */
  27. __attribute__ ((weak))
  28. bool process_record_user_kb(uint16_t keycode, keyrecord_t *record) {
  29. return true;
  30. }
  31. bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  32. switch (keycode) {
  33. case KC_SEC1 ... KC_SEC2: /* Secrets! Externally defined strings, not stored in repo */
  34. if (!record->event.pressed) {
  35. clear_oneshot_layer_state(ONESHOT_OTHER_KEY_PRESSED);
  36. send_string_with_delay(secrets[keycode - KC_SEC1], MACRO_TIMER);
  37. }
  38. return false;
  39. break;
  40. }
  41. return process_record_user_kb(keycode, record);
  42. };