aboutsummaryrefslogtreecommitdiff
path: root/quantum/process_keycode/process_oneshot.c
blob: 6c43da101168415c097ec2e45b25a50ddfff78d6 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
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;
}