This commit is contained in:
ClownFish 2025-07-14 19:10:01 +01:00 committed by GitHub
commit 8d831db433
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
7 changed files with 61 additions and 113 deletions

View File

@ -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(MS_WHLD);
} else {
tap_code(MS_WHLU);
}
} else if (index == 2) {
// Volume Up/Down
if (clockwise) {
tap_code(KC_VOLU);
} else {
tap_code(KC_VOLD);
}
}
return true;
}
#endif

View File

@ -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",
@ -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": {
@ -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},
@ -96,27 +96,27 @@
{"flags": 2, "x": 74, "y": 0},
{"flags": 2, "x": 224, "y": 0}
],
"max_brightness": 200,
"max_brightness": 200
},
"layouts": {
"LAYOUT": {
"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},
@ -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},

View File

@ -17,45 +17,52 @@
#include QMK_KEYBOARD_H
enum layers {
_QWERTY,
_LAYERTWO
_BASE,
_FN
};
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
/* ┌───┐ ┌───────┐┌───┬───┬───┐┌───┬───┬───┐
* ESC KC_BSPCF1 F2 F3 F4 F5 F6
* Fn KC_BSPCF1 F2 F3 F4 F5 F6
*
*
* NUM / * - PASSCRPSC
* NUM / * - PSCSCRPAS
*
* 7 8 9 INSHOMPGUHOM END
* +
* 4 5 6 ENDDELPGD
* 4 5 6 DELENDPGD
*
* 1 2 3 E UP B
* 1 2 3 E UP
* N
* 0 DEL T LFTDWNRHT
*
*/
[_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] = {
[_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

View File

@ -0,0 +1 @@
ENCODER_MAP_ENABLE = yes

View File

@ -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

View File

@ -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

View File

@ -1 +0,0 @@
RGB_MATRIX_CUSTOM_KB = yes