summaryrefslogtreecommitdiff
path: root/keyboards/nullbitsco
diff options
context:
space:
mode:
authorNick Brassel <nick@tzarc.org>2023-02-23 09:19:00 +1100
committerGitHub <noreply@github.com>2023-02-23 09:19:00 +1100
commit7f805cc7799deb0ca75f751cebd32c6640058af9 (patch)
treeebc20e21b50812ea4455bdfc5567c8025aa4fc74 /keyboards/nullbitsco
parent403b0addea48548abdbde6203d8673f2b77164a7 (diff)
VIA Protocol 12 + fixes (#19916)
Co-authored-by: Wilba <wilba@wilba.tech> Co-authored-by: zvecr <git@zvecr.com>
Diffstat (limited to 'keyboards/nullbitsco')
-rw-r--r--keyboards/nullbitsco/nibble/keymaps/oled_bongocat/keymap.c2
-rw-r--r--keyboards/nullbitsco/nibble/keymaps/via/keymap.c13
2 files changed, 2 insertions, 13 deletions
diff --git a/keyboards/nullbitsco/nibble/keymaps/oled_bongocat/keymap.c b/keyboards/nullbitsco/nibble/keymaps/oled_bongocat/keymap.c
index 631f28171a..33652005cb 100644
--- a/keyboards/nullbitsco/nibble/keymaps/oled_bongocat/keymap.c
+++ b/keyboards/nullbitsco/nibble/keymaps/oled_bongocat/keymap.c
@@ -29,7 +29,7 @@ enum layer_names {
29#define KC_DISC_DEAF KC_F24 29#define KC_DISC_DEAF KC_F24
30 30
31enum custom_keycodes { 31enum custom_keycodes {
32 PROG = USER00, 32 PROG = QK_KB_0,
33 DISC_MUTE, 33 DISC_MUTE,
34 DISC_DEAF, 34 DISC_DEAF,
35 SUPER_ALT_TAB, 35 SUPER_ALT_TAB,
diff --git a/keyboards/nullbitsco/nibble/keymaps/via/keymap.c b/keyboards/nullbitsco/nibble/keymaps/via/keymap.c
index aab6a41af3..b71f9119ef 100644
--- a/keyboards/nullbitsco/nibble/keymaps/via/keymap.c
+++ b/keyboards/nullbitsco/nibble/keymaps/via/keymap.c
@@ -24,11 +24,9 @@ enum layer_names {
24 24
25#define KC_DISC_MUTE KC_F23 25#define KC_DISC_MUTE KC_F23
26#define KC_DISC_DEAF KC_F24 26#define KC_DISC_DEAF KC_F24
27#define NUM_CUST_KEYCODES (_NUM_CUST_KCS - SAFE_RANGE)
28#define VIA_KEYCODE_RANGE USER00
29 27
30enum custom_keycodes { 28enum custom_keycodes {
31 PROG = SAFE_RANGE, 29 PROG = QK_KB_0,
32 DISC_MUTE, 30 DISC_MUTE,
33 DISC_DEAF, 31 DISC_DEAF,
34 SUPER_ALT_TAB, 32 SUPER_ALT_TAB,
@@ -76,17 +74,8 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
76 74
77}; 75};
78 76
79void map_via_keycode(uint16_t * keycode) {
80 if (abs(*keycode - VIA_KEYCODE_RANGE) < NUM_CUST_KEYCODES) { //make into macro?
81 dprintf("VIA custom keycode found, mapping to QMK keycode.\n");
82 uint16_t new_keycode = (*keycode - VIA_KEYCODE_RANGE) + SAFE_RANGE;
83 dprintf("VIA KC: %u QMK KC: %u\n", *keycode, new_keycode);
84 *keycode = new_keycode;
85 }
86}
87 77
88bool process_record_user(uint16_t keycode, keyrecord_t *record) { 78bool process_record_user(uint16_t keycode, keyrecord_t *record) {
89 map_via_keycode(&keycode);
90 // Send keystrokes to host keyboard, if connected (see readme) 79 // Send keystrokes to host keyboard, if connected (see readme)
91 process_record_remote_kb(keycode, record); 80 process_record_remote_kb(keycode, record);
92 switch(keycode) { 81 switch(keycode) {