From ddd190ce87ad4f77c85ecbd52c8f21dd0447a8aa Mon Sep 17 00:00:00 2001 From: clownfish-og <177758267+clownfish-og@users.noreply.github.com> Date: Sun, 13 Apr 2025 20:01:12 -0400 Subject: [PATCH 1/7] remove incorrect encoder resolution --- keyboards/doio/kb38/keyboard.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/keyboards/doio/kb38/keyboard.json b/keyboards/doio/kb38/keyboard.json index 5214c60d084..07bcc019ac9 100644 --- a/keyboards/doio/kb38/keyboard.json +++ b/keyboards/doio/kb38/keyboard.json @@ -28,7 +28,7 @@ "rotary": [ {"pin_a": "C7", "pin_b": "C6"}, {"pin_a": "F7", "pin_b": "E6"}, - {"pin_a": "D6", "pin_b": "D7", "resolution": 2} + {"pin_a": "D6", "pin_b": "D7"} ] }, "ws2812": { From 091a0747c4c4375bba455a4563587e46faea614b Mon Sep 17 00:00:00 2001 From: clownfish-og <177758267+clownfish-og@users.noreply.github.com> Date: Sun, 13 Apr 2025 20:02:08 -0400 Subject: [PATCH 2/7] syntax --- keyboards/doio/kb38/keyboard.json | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/keyboards/doio/kb38/keyboard.json b/keyboards/doio/kb38/keyboard.json index 07bcc019ac9..d25be2df4e8 100644 --- a/keyboards/doio/kb38/keyboard.json +++ b/keyboards/doio/kb38/keyboard.json @@ -96,7 +96,7 @@ {"flags": 2, "x": 74, "y": 0}, {"flags": 2, "x": 224, "y": 0} ], - "max_brightness": 200, + "max_brightness": 200 }, "layouts": { "LAYOUT": { @@ -143,7 +143,7 @@ {"matrix": [4, 3], "label": "PENT", "x": 3, "y": 4.25, "h": 2}, {"matrix": [4, 5], "label": "UP", "x": 5.25, "y": 4.25}, - {"matrix": [5, 7], "label": "KNOB_D", "x": 7.5, "y": 3.25, "w": 3, "h": 3} + {"matrix": [5, 7], "label": "KNOB_D", "x": 7.5, "y": 3.25, "w": 3, "h": 3}, {"matrix": [5, 0], "label": "0", "x": 0, "y": 5.25, "w": 2}, {"matrix": [5, 1], "label": "PDOT", "x": 2, "y": 5.25}, From 7c3cc826cb445409a66f2f7bb5b89966ec3eda6b Mon Sep 17 00:00:00 2001 From: clownfish-og <177758267+clownfish-og@users.noreply.github.com> Date: Thu, 24 Apr 2025 15:35:41 -0400 Subject: [PATCH 3/7] move encoders to keymap, encoder_map --- keyboards/doio/kb38/kb38.c | 33 -------------------- keyboards/doio/kb38/keymaps/default/keymap.c | 7 +++++ keyboards/doio/kb38/keymaps/default/rules.mk | 1 + 3 files changed, 8 insertions(+), 33 deletions(-) create mode 100644 keyboards/doio/kb38/keymaps/default/rules.mk diff --git a/keyboards/doio/kb38/kb38.c b/keyboards/doio/kb38/kb38.c index 55a88a068b2..ce036d7fd14 100644 --- a/keyboards/doio/kb38/kb38.c +++ b/keyboards/doio/kb38/kb38.c @@ -34,36 +34,3 @@ bool oled_task_kb(void) { return true; } #endif - -//Knobs -#ifdef ENCODER_ENABLE -bool encoder_update_kb(uint8_t index, bool clockwise) { - if (!encoder_update_user(index, clockwise)) { - return false; - } - - if (index == 0) { - // Page Up/Down - if (clockwise) { - tap_code(KC_PGDN); - } else { - tap_code(KC_PGUP); - } - } else if (index == 1) { - // Mouse Wheel Up/Down - if (clockwise) { - tap_code(KC_MS_WH_DOWN); - } else { - tap_code(KC_MS_WH_UP); - } - } else if (index == 2) { - // Volume Up/Down - if (clockwise) { - tap_code(KC_VOLU); - } else { - tap_code(KC_VOLD); - } - } - return true; -} -#endif \ No newline at end of file diff --git a/keyboards/doio/kb38/keymaps/default/keymap.c b/keyboards/doio/kb38/keymaps/default/keymap.c index 6f5304c0048..5c0fbf5da34 100644 --- a/keyboards/doio/kb38/keymaps/default/keymap.c +++ b/keyboards/doio/kb38/keymaps/default/keymap.c @@ -59,3 +59,10 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { The large knob press is mapped as KC_B, despite it not having one. I'm not quite sure why, but the only reason it can't be clicked is because the potentiometer is different. If you were to replace it with one that can be clicked, it would work. I shorted it and it does work.*/ + +#ifdef ENCODER_MAP_ENABLE +const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { + [0] = { ENCODER_CCW_CW(KC_PGUP, KC_PGDN), ENCODER_CCW_CW(MS_WHLU, MS_WHLD), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [1] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS) } +}; +#endif diff --git a/keyboards/doio/kb38/keymaps/default/rules.mk b/keyboards/doio/kb38/keymaps/default/rules.mk new file mode 100644 index 00000000000..ee325681483 --- /dev/null +++ b/keyboards/doio/kb38/keymaps/default/rules.mk @@ -0,0 +1 @@ +ENCODER_MAP_ENABLE = yes From 81fc9d9aab82416f5012d1fc43a8cf669d647ce1 Mon Sep 17 00:00:00 2001 From: clownfish-og <177758267+clownfish-og@users.noreply.github.com> Date: Thu, 24 Apr 2025 15:47:46 -0400 Subject: [PATCH 4/7] fixup keymap and layout --- keyboards/doio/kb38/keyboard.json | 24 +++++------ keyboards/doio/kb38/keymaps/default/keymap.c | 42 ++++++++++---------- 2 files changed, 33 insertions(+), 33 deletions(-) diff --git a/keyboards/doio/kb38/keyboard.json b/keyboards/doio/kb38/keyboard.json index d25be2df4e8..0b27acba7b2 100644 --- a/keyboards/doio/kb38/keyboard.json +++ b/keyboards/doio/kb38/keyboard.json @@ -1,6 +1,6 @@ { - "manufacturer": "Doio", - "keyboard_name": "doio/kb38", + "manufacturer": "DOIO", + "keyboard_name": "KB38-01", "maintainer": "PepperKats", "url": "https://www.keebmonkey.com/products/megalodon-doio-triple-knob-38-keyboard-with-oled-screen", "bootloader": "atmel-dfu", @@ -103,20 +103,20 @@ "layout": [ {"matrix": [0, 0], "label": "ESC", "x": 0, "y": 0}, {"matrix": [0, 1], "label": "BSPC", "x": 2, "y": 0, "w": 2}, - {"matrix": [0, 2], "label": "RGB BACK", "x": 4.25, "y": 0}, - {"matrix": [0, 3], "label": "RGB OFF", "x": 5.25, "y": 0}, - {"matrix": [0, 4], "label": "RGB FORW", "x": 6.25, "y": 0}, - {"matrix": [0, 5], "label": "MAKE", "x": 7.5, "y": 0}, - {"matrix": [0, 6], "label": "REBOOT", "x": 8.5, "y": 0}, - {"matrix": [0, 7], "label": "BOOTLOAD", "x": 9.5, "y": 0}, + {"matrix": [0, 2], "label": "F1", "x": 4.25, "y": 0}, + {"matrix": [0, 3], "label": "F2", "x": 5.25, "y": 0}, + {"matrix": [0, 4], "label": "F3", "x": 6.25, "y": 0}, + {"matrix": [0, 5], "label": "F4", "x": 7.5, "y": 0}, + {"matrix": [0, 6], "label": "F5", "x": 8.5, "y": 0}, + {"matrix": [0, 7], "label": "F6", "x": 9.5, "y": 0}, {"matrix": [1, 0], "label": "NUMLOCK", "x": 0, "y": 1.25}, {"matrix": [1, 1], "label": "PSLS", "x": 1, "y": 1.25}, {"matrix": [1, 2], "label": "PAST", "x": 2, "y": 1.25}, {"matrix": [1, 3], "label": "PMNS", "x": 3, "y": 1.25}, - {"matrix": [1, 4], "label": "PAUS", "x": 4.25, "y": 1.25}, + {"matrix": [1, 4], "label": "PSCR", "x": 4.25, "y": 1.25}, {"matrix": [1, 5], "label": "SCRL", "x": 5.25, "y": 1.25}, - {"matrix": [1, 6], "label": "PSCR", "x": 6.25, "y": 1.25}, + {"matrix": [1, 6], "label": "PAUS", "x": 6.25, "y": 1.25}, {"matrix": [2, 0], "label": "7", "x": 0, "y": 2.25}, {"matrix": [2, 1], "label": "8", "x": 1, "y": 2.25}, @@ -133,8 +133,8 @@ {"matrix": [3, 0], "label": "4", "x": 0, "y": 3.25}, {"matrix": [3, 1], "label": "5", "x": 1, "y": 3.25}, {"matrix": [3, 2], "label": "6", "x": 2, "y": 3.25}, - {"matrix": [3, 3], "label": "END", "x": 4.25, "y": 3.25}, - {"matrix": [3, 4], "label": "DEL", "x": 5.25, "y": 3.25}, + {"matrix": [3, 3], "label": "DEL", "x": 4.25, "y": 3.25}, + {"matrix": [3, 4], "label": "END", "x": 5.25, "y": 3.25}, {"matrix": [3, 5], "label": "PGDN", "x": 6.25, "y": 3.25}, {"matrix": [4, 0], "label": "1", "x": 0, "y": 4.25}, diff --git a/keyboards/doio/kb38/keymaps/default/keymap.c b/keyboards/doio/kb38/keymaps/default/keymap.c index 5c0fbf5da34..fac96098947 100644 --- a/keyboards/doio/kb38/keymaps/default/keymap.c +++ b/keyboards/doio/kb38/keymaps/default/keymap.c @@ -17,52 +17,52 @@ #include QMK_KEYBOARD_H enum layers { - _QWERTY, - _LAYERTWO + _BASE, + _FN }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { /* ┌───┐ ┌───────┐┌───┬───┬───┐┌───┬───┬───┐ - * │ESC│ │KC_BSPC││F1 │F2 │F3 ││F4 │F5 │F6 │ + * │Fn │ │KC_BSPC││F1 │F2 │F3 ││F4 │F5 │F6 │ * └───┘ └───────┘└───┴───┴───┘└───┴───┴───┘ * ┌───┬───┬───┬───┐┌───┬───┬───┐ - * │NUM│ / │ * │ - ││PAS│SCR│PSC│ + * │NUM│ / │ * │ - ││PSC│SCR│PAS│ * ├───┼───┼───┼───┤├───┼───┼───┤┌───┐ ┌───┐ * │ 7 │ 8 │ 9 │ ││INS│HOM│PGU││HOM│ │END│ * ├───┼───┼───┤ + │├───┼───┼───┤├───┴───┴───┤ - * │ 4 │ 5 │ 6 │ ││END│DEL│PGD││ │ + * │ 4 │ 5 │ 6 │ ││DEL│END│PGD││ │ * ├───┼───┼───┼───┤└───┼───┼───┘│ │ - * │ 1 │ 2 │ 3 │ E │ │UP │ │ B │ + * │ 1 │ 2 │ 3 │ E │ │UP │ │ │ * ├───┴───┼───┤ N │┌───┼───┼───┐│ │ * │ 0 │DEL│ T ││LFT│DWN│RHT││ │ * └───────┴───┴───┘└───┴───┴───┘└───────────┘ */ - [_QWERTY] = LAYOUT( - MO(1), KC_BSPC, RM_PREV, RM_TOGG, RM_NEXT, KC_F1, KC_F2, KC_F3, - KC_NUM, KC_PSLS, KC_PAST, KC_PMNS, KC_PAUS, KC_SCRL, KC_PSCR, + [_BASE] = LAYOUT( + MO(_FN), KC_BSPC, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KC_F6, + KC_NUM, KC_PSLS, KC_PAST, KC_PMNS, KC_PSCR, KC_SCRL, KC_PAUS, KC_P7, KC_P8, KC_P9, KC_PPLS, KC_INS, KC_HOME, KC_PGUP, KC_HOME, KC_END, - KC_P4, KC_P5, KC_P6, KC_END, KC_DEL, KC_PGDN, - KC_P1, KC_P2, KC_P3, KC_PENT, KC_UP, KC_B, + KC_P4, KC_P5, KC_P6, KC_DEL, KC_END, KC_PGDN, + KC_P1, KC_P2, KC_P3, KC_PENT, KC_UP, KC_NO, KC_P0, KC_PDOT, KC_LEFT, KC_DOWN, KC_RGHT ), - [_LAYERTWO] = LAYOUT( - _______, KC_BSPC, RM_PREV, RM_TOGG, RM_NEXT, KC_A, QK_RBT, QK_BOOT, - KC_NUM, KC_PSLS, KC_PAST, KC_PMNS, KC_PAUS, KC_SCRL, KC_PSCR, - KC_P7, KC_P8, KC_P9, KC_PPLS, KC_INS, KC_HOME, KC_PGUP, KC_HOME, KC_END, - KC_P4, KC_P5, KC_P6, KC_END, KC_DEL, KC_PGDN, - KC_P1, KC_P2, KC_P3, KC_PENT, KC_UP, KC_B, - KC_P0, KC_PDOT, KC_LEFT, KC_DOWN, KC_RGHT + [_FN] = LAYOUT( + _______, RM_TOGG, _______, RM_SATU, RM_SATD, RM_PREV, RM_NEXT, _______, + _______, _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, _______, _______, RM_SPDD, RM_SPDU, + _______, _______, _______, _______, _______, _______, + _______, _______, _______, _______, _______, KC_NO, + _______, _______, _______, _______, _______ ) }; /*NOTE FOR PERSON MODIFYING KEYMAP -The large knob press is mapped as KC_B, despite it not having one. +The large knob press is mapped as KC_NO, despite it not having one. I'm not quite sure why, but the only reason it can't be clicked is because the potentiometer is different. If you were to replace it with one that can be clicked, it would work. I shorted it and it does work.*/ #ifdef ENCODER_MAP_ENABLE const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][NUM_DIRECTIONS] = { - [0] = { ENCODER_CCW_CW(KC_PGUP, KC_PGDN), ENCODER_CCW_CW(MS_WHLU, MS_WHLD), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, - [1] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS) } + [_BASE] = { ENCODER_CCW_CW(KC_PGUP, KC_PGDN), ENCODER_CCW_CW(MS_WHLU, MS_WHLD), ENCODER_CCW_CW(KC_VOLD, KC_VOLU) }, + [_FN] = { ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS), ENCODER_CCW_CW(KC_TRNS, KC_TRNS) } }; #endif From 77593ed75e123a3415e44f2878556e8d2d086aae Mon Sep 17 00:00:00 2001 From: clownfish-og <177758267+clownfish-og@users.noreply.github.com> Date: Thu, 24 Apr 2025 15:48:53 -0400 Subject: [PATCH 5/7] remove unused custom animation --- keyboards/doio/kb38/rgb_matrix_kb.inc | 27 --------------------------- keyboards/doio/kb38/rules.mk | 1 - 2 files changed, 28 deletions(-) delete mode 100644 keyboards/doio/kb38/rgb_matrix_kb.inc delete mode 100644 keyboards/doio/kb38/rules.mk diff --git a/keyboards/doio/kb38/rgb_matrix_kb.inc b/keyboards/doio/kb38/rgb_matrix_kb.inc deleted file mode 100644 index 6e672c889dc..00000000000 --- a/keyboards/doio/kb38/rgb_matrix_kb.inc +++ /dev/null @@ -1,27 +0,0 @@ -RGB_MATRIX_EFFECT(trans) -#ifdef RGB_MATRIX_CUSTOM_EFFECT_IMPLS - -static bool trans(effect_params_t* params) { - RGB_MATRIX_USE_LIMITS(led_min, led_max); - for (int i = 0; i < 8; i++) { - rgb_matrix_set_color(i, 0x00, 0x00, 0xFF); - } - for (int i = 8; i < 15; i++) { - rgb_matrix_set_color(i, 0xFF, 0x00, 0x92); - } - for (int i = 15; i < 28; i++) { - rgb_matrix_set_color(i, 0xFF, 0xFF, 0xFF); - } - for (int i = 28; i < 33; i++) { - rgb_matrix_set_color(i, 0xFF, 0x00, 0x92); - } - for (int i = 33; i < 38; i++) { - rgb_matrix_set_color(i, 0x00, 0x00, 0xFF); - } - for (int i = 38; i < 44; i++) { - rgb_matrix_set_color(i, 0x00, 0x00, 0xFF); - } - return rgb_matrix_check_finished_leds(led_max); -} - -#endif \ No newline at end of file diff --git a/keyboards/doio/kb38/rules.mk b/keyboards/doio/kb38/rules.mk deleted file mode 100644 index 942ef4c5dbd..00000000000 --- a/keyboards/doio/kb38/rules.mk +++ /dev/null @@ -1 +0,0 @@ -RGB_MATRIX_CUSTOM_KB = yes From 51be3f427252039d4efc44e8d0c8ae97b4fe788f Mon Sep 17 00:00:00 2001 From: clownfish-og <177758267+clownfish-og@users.noreply.github.com> Date: Mon, 19 May 2025 15:47:33 -0400 Subject: [PATCH 6/7] add bootmagic instructions --- keyboards/doio/kb38/readme.md | 1 + 1 file changed, 1 insertion(+) diff --git a/keyboards/doio/kb38/readme.md b/keyboards/doio/kb38/readme.md index 7456316f159..997920c2a63 100644 --- a/keyboards/doio/kb38/readme.md +++ b/keyboards/doio/kb38/readme.md @@ -22,5 +22,6 @@ See the [build environment setup](https://docs.qmk.fm/#/getting_started_build_to Enter the bootloader in 3 ways: +* **Bootmagic reset**: Hold down the key at (0,0) in the matrix (the top left key) and plug in the keyboard * **Physical reset button**: Briefly press the button on the back of the PCB * **Keycode in layout**: Press the key mapped to `QK_BOOT` if it is available From ca38123ea2a8e6287142873390b77d97aa377b23 Mon Sep 17 00:00:00 2001 From: clownfish-og <177758267+clownfish-og@users.noreply.github.com> Date: Mon, 19 May 2025 15:48:09 -0400 Subject: [PATCH 7/7] led flags --- keyboards/doio/kb38/keyboard.json | 36 +++++++++++++++---------------- 1 file changed, 18 insertions(+), 18 deletions(-) diff --git a/keyboards/doio/kb38/keyboard.json b/keyboards/doio/kb38/keyboard.json index 0b27acba7b2..6e2907ac928 100644 --- a/keyboards/doio/kb38/keyboard.json +++ b/keyboards/doio/kb38/keyboard.json @@ -45,19 +45,19 @@ }, "driver": "ws2812", "layout": [ - {"flags": 4, "matrix": [0, 0], "x": 0, "y": 0}, - {"flags": 4, "matrix": [0, 1], "x": 62, "y": 0}, - {"flags": 4, "matrix": [0, 2], "x": 99, "y": 0}, - {"flags": 4, "matrix": [0, 3], "x": 124, "y": 0}, - {"flags": 4, "matrix": [0, 4], "x": 149, "y": 0}, - {"flags": 4, "matrix": [0, 5], "x": 174, "y": 0}, - {"flags": 4, "matrix": [0, 6], "x": 199, "y": 0}, - {"flags": 4, "matrix": [0, 7], "x": 224, "y": 0}, + {"flags": 1, "matrix": [0, 0], "x": 0, "y": 0}, + {"flags": 1, "matrix": [0, 1], "x": 62, "y": 0}, + {"flags": 1, "matrix": [0, 2], "x": 99, "y": 0}, + {"flags": 1, "matrix": [0, 3], "x": 124, "y": 0}, + {"flags": 1, "matrix": [0, 4], "x": 149, "y": 0}, + {"flags": 1, "matrix": [0, 5], "x": 174, "y": 0}, + {"flags": 1, "matrix": [0, 6], "x": 199, "y": 0}, + {"flags": 1, "matrix": [0, 7], "x": 224, "y": 0}, - {"flags": 4, "matrix": [1, 0], "x": 0, "y": 12}, - {"flags": 4, "matrix": [1, 1], "x": 24, "y": 12}, - {"flags": 4, "matrix": [1, 2], "x": 49, "y": 12}, - {"flags": 4, "matrix": [1, 3], "x": 74, "y": 12}, + {"flags": 1, "matrix": [1, 0], "x": 0, "y": 12}, + {"flags": 1, "matrix": [1, 1], "x": 24, "y": 12}, + {"flags": 1, "matrix": [1, 2], "x": 49, "y": 12}, + {"flags": 1, "matrix": [1, 3], "x": 74, "y": 12}, {"flags": 4, "matrix": [1, 4], "x": 99, "y": 12}, {"flags": 4, "matrix": [1, 5], "x": 124, "y": 12}, {"flags": 4, "matrix": [1, 6], "x": 149, "y": 12}, @@ -65,7 +65,7 @@ {"flags": 4, "matrix": [2, 0], "x": 0, "y": 25}, {"flags": 4, "matrix": [2, 1], "x": 24, "y": 25}, {"flags": 4, "matrix": [2, 2], "x": 49, "y": 25}, - {"flags": 4, "matrix": [2, 3], "x": 74, "y": 32}, + {"flags": 1, "matrix": [2, 3], "x": 74, "y": 32}, {"flags": 4, "matrix": [2, 4], "x": 90, "y": 25}, {"flags": 4, "matrix": [2, 5], "x": 124, "y": 25}, {"flags": 4, "matrix": [2, 6], "x": 149, "y": 25}, @@ -80,14 +80,14 @@ {"flags": 4, "matrix": [4, 0], "x": 0, "y": 51}, {"flags": 4, "matrix": [4, 1], "x": 24, "y": 51}, {"flags": 4, "matrix": [4, 2], "x": 49, "y": 51}, - {"flags": 4, "matrix": [4, 3], "x": 74, "y": 57}, - {"flags": 4, "matrix": [4, 5], "x": 124, "y": 51}, + {"flags": 1, "matrix": [4, 3], "x": 74, "y": 57}, + {"flags": 1, "matrix": [4, 5], "x": 124, "y": 51}, {"flags": 4, "matrix": [5, 0], "x": 12, "y": 64}, {"flags": 4, "matrix": [5, 1], "x": 49, "y": 64}, - {"flags": 4, "matrix": [5, 2], "x": 99, "y": 64}, - {"flags": 4, "matrix": [5, 3], "x": 124, "y": 64}, - {"flags": 4, "matrix": [5, 4], "x": 149, "y": 64}, + {"flags": 1, "matrix": [5, 2], "x": 99, "y": 64}, + {"flags": 1, "matrix": [5, 3], "x": 124, "y": 64}, + {"flags": 1, "matrix": [5, 4], "x": 149, "y": 64}, {"flags": 2, "x": 224, "y": 64}, {"flags": 2, "x": 74, "y": 64},