summaryrefslogtreecommitdiffstats
path: root/users/davidkristoffersen/macros/debug.c
blob: 64fdc4a702197b641bac046a6cea89285b941d2f (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
// Copyright 2022 David Kristoffersen (@davidkristoffersen)
// SPDX-License-Identifier: GPL-3.0-or-later

#include "macros.h"

// Replace key records with macros
bool handle_test(uint16_t keycode) {
    switch (keycode) {
    case KC_T0: {
        // Test QK_MAKE command
        SEND_STRING("qmk compile -kb " QMK_KEYBOARD " -km " QMK_KEYMAP);
        break;
    }
    case KC_T1:
        // Test ascii characters
        SEND_STRING(" !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~");
        break;
    case KC_T2:
#ifdef LAYER_NO
        // Test other characters
        tap_code16(NO_AE);
        tap_code16(NO_OE);
        tap_code16(NO_AA);
        tap_code16(S(NO_AE));
        tap_code16(S(NO_OE));
        tap_code16(S(NO_AA));
#endif
        return false;
    }
    return true;
};

bool process_debug(uint16_t keycode, keyrecord_t* record) {
    HANDLE_FALSE(handle_test(keycode));
    return true;
}