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.

31 lines
868 B

  1. #include "quantum.h"
  2. #include "dshields.h"
  3. extern bool process_record_dynamic_macro(uint16_t keycode, keyrecord_t *record);
  4. bool process_record_user(uint16_t keycode, keyrecord_t *record) {
  5. if (!process_record_dynamic_macro(keycode, record)) {
  6. return false;
  7. }
  8. if (keycode == KC_ESC && record->event.pressed) {
  9. bool rc = true;
  10. uint8_t mods = 0;
  11. if ((mods = get_oneshot_mods()) && !has_oneshot_mods_timed_out()) {
  12. clear_oneshot_mods();
  13. unregister_mods(mods);
  14. rc = false;
  15. }
  16. if ((mods = get_oneshot_locked_mods())) {
  17. clear_oneshot_locked_mods();
  18. unregister_mods(mods);
  19. rc = false;
  20. }
  21. if (is_oneshot_layer_active()) {
  22. layer_clear();
  23. rc = false;
  24. }
  25. return rc;
  26. }
  27. return true;
  28. }