aboutsummaryrefslogtreecommitdiff
path: root/quantum/process_keycode/process_oneshot.c
diff options
context:
space:
mode:
Diffstat (limited to 'quantum/process_keycode/process_oneshot.c')
-rw-r--r--quantum/process_keycode/process_oneshot.c25
1 files changed, 25 insertions, 0 deletions
diff --git a/quantum/process_keycode/process_oneshot.c b/quantum/process_keycode/process_oneshot.c
new file mode 100644
index 0000000000..6c43da1011
--- /dev/null
+++ b/quantum/process_keycode/process_oneshot.c
@@ -0,0 +1,25 @@
+// Copyright 2025 QMK
+// SPDX-License-Identifier: GPL-2.0-or-later
+
+#include "process_oneshot.h"
+#include "action_util.h"
+
+bool process_oneshot(uint16_t keycode, keyrecord_t *record) {
+#ifndef NO_ACTION_ONESHOT
+ if (record->event.pressed) {
+ switch (keycode) {
+ case QK_ONE_SHOT_TOGGLE:
+ oneshot_toggle();
+ return false;
+ case QK_ONE_SHOT_ON:
+ oneshot_enable();
+ return false;
+ case QK_ONE_SHOT_OFF:
+ oneshot_disable();
+ return false;
+ }
+ }
+#endif
+
+ return true;
+}