summaryrefslogtreecommitdiff
path: root/keyboards/crkbd/keymaps/thunderbird2086/process_records.c
blob: 381cf281e5cca72a245d5ee0373bf48ad3c0f175 (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
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
// Copyright 2021 Allen Choi (@thunderbird2086)
// SPDX-License-Identifier: GPL-2.0-or-later

#include QMK_KEYBOARD_H

#include "keycodes.h"

__attribute__((weak))
bool process_record_keymap(uint16_t keycode, keyrecord_t *record) {
    return true;
}

__attribute__((weak))
bool process_record_secrets(uint16_t keycode, keyrecord_t *record) {
    return true;
}

#if defined(OLED_ENABLE)
__attribute__((weak))
bool process_record_oled(uint16_t keycode, keyrecord_t *record) {
    return true;
}
#endif

bool process_record_user(uint16_t keycode, keyrecord_t *record) {
    switch (keycode) {

    case COLEMAK:
        if (record->event.pressed) {
            set_single_persistent_default_layer(_COLEMAK);
        }
        break;
    case QWERTY:
        if (record->event.pressed) {
            set_single_persistent_default_layer(_QWERTY);
        }
        break;
    }

    return process_record_keymap(keycode, record) && process_record_secrets(keycode, record)
#   if defined(OLED_ENABLE)
           && process_record_oled(keycode, record)
#   endif
           ;
}