dshields.c 700 B

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