process_oneshot.c 611 B

12345678910111213141516171819202122232425
  1. // Copyright 2025 QMK
  2. // SPDX-License-Identifier: GPL-2.0-or-later
  3. #include "process_oneshot.h"
  4. #include "action_util.h"
  5. bool process_oneshot(uint16_t keycode, keyrecord_t *record) {
  6. #ifndef NO_ACTION_ONESHOT
  7. if (record->event.pressed) {
  8. switch (keycode) {
  9. case QK_ONE_SHOT_TOGGLE:
  10. oneshot_toggle();
  11. return false;
  12. case QK_ONE_SHOT_ON:
  13. oneshot_enable();
  14. return false;
  15. case QK_ONE_SHOT_OFF:
  16. oneshot_disable();
  17. return false;
  18. }
  19. }
  20. #endif
  21. return true;
  22. }