diff --git a/keyboards/bastardkb/dilemma/3x5_3/info.json b/keyboards/bastardkb/dilemma/3x5_3/info.json index 78aa63c7113..f3a39613302 100644 --- a/keyboards/bastardkb/dilemma/3x5_3/info.json +++ b/keyboards/bastardkb/dilemma/3x5_3/info.json @@ -118,9 +118,9 @@ {"matrix": [0, 3], "x": 56, "y": 9, "flags": 4}, {"matrix": [0, 2], "x": 39, "y": 5, "flags": 4}, {"matrix": [0, 1], "x": 22, "y": 10, "flags": 4}, - {"matrix": [0, 0], "x": 5, "y": 15, "flags": 4}, + {"matrix": [0, 0], "x": 5, "y": 15, "flags": 1}, - {"matrix": [1, 0], "x": 5, "y": 30, "flags": 4}, + {"matrix": [1, 0], "x": 5, "y": 30, "flags": 1}, {"matrix": [1, 1], "x": 22, "y": 25, "flags": 4}, {"matrix": [1, 2], "x": 39, "y": 20, "flags": 4}, {"matrix": [1, 3], "x": 56, "y": 24, "flags": 4}, @@ -130,7 +130,7 @@ {"matrix": [2, 3], "x": 56, "y": 39, "flags": 4}, {"matrix": [2, 2], "x": 39, "y": 35, "flags": 4}, {"matrix": [2, 1], "x": 22, "y": 40, "flags": 4}, - {"matrix": [2, 0], "x": 5, "y": 45, "flags": 4}, + {"matrix": [2, 0], "x": 5, "y": 45, "flags": 1}, {"matrix": [3, 2], "x": 45, "y": 51, "flags": 4}, {"matrix": [3, 0], "x": 64, "y": 53, "flags": 4}, @@ -163,9 +163,9 @@ {"matrix": [4, 3], "x": 168, "y": 9, "flags": 4}, {"matrix": [4, 2], "x": 185, "y": 5, "flags": 4}, {"matrix": [4, 1], "x": 202, "y": 10, "flags": 4}, - {"matrix": [4, 0], "x": 219, "y": 15, "flags": 4}, + {"matrix": [4, 0], "x": 219, "y": 15, "flags": 1}, - {"matrix": [5, 0], "x": 219, "y": 30, "flags": 4}, + {"matrix": [5, 0], "x": 219, "y": 30, "flags": 1}, {"matrix": [5, 1], "x": 202, "y": 25, "flags": 4}, {"matrix": [5, 2], "x": 185, "y": 20, "flags": 4}, {"matrix": [5, 3], "x": 168, "y": 24, "flags": 4}, @@ -175,7 +175,7 @@ {"matrix": [6, 3], "x": 168, "y": 39, "flags": 4}, {"matrix": [6, 2], "x": 185, "y": 35, "flags": 4}, {"matrix": [6, 1], "x": 202, "y": 40, "flags": 4}, - {"matrix": [6, 0], "x": 219, "y": 45, "flags": 4}, + {"matrix": [6, 0], "x": 219, "y": 45, "flags": 1}, {"matrix": [7, 2], "x": 179, "y": 51, "flags": 4}, {"matrix": [7, 0], "x": 160, "y": 53, "flags": 4}, diff --git a/keyboards/bastardkb/dilemma/3x5_3/keymaps/default/keymap.c b/keyboards/bastardkb/dilemma/3x5_3/keymaps/default/keymap.c index 9c19afc30a2..b87784bbb94 100644 --- a/keyboards/bastardkb/dilemma/3x5_3/keymaps/default/keymap.c +++ b/keyboards/bastardkb/dilemma/3x5_3/keymaps/default/keymap.c @@ -15,7 +15,6 @@ * along with this program. If not, see . */ -#include "keycodes.h" #include QMK_KEYBOARD_H enum dilemma_keymap_layers { diff --git a/keyboards/bastardkb/dilemma/3x5_3/keymaps/default/readme.md b/keyboards/bastardkb/dilemma/3x5_3/keymaps/default/readme.md deleted file mode 100644 index 8da7a74bf03..00000000000 --- a/keyboards/bastardkb/dilemma/3x5_3/keymaps/default/readme.md +++ /dev/null @@ -1 +0,0 @@ -# Dilemma 3x5+3 default keymap diff --git a/keyboards/bastardkb/dilemma/3x5_3/keymaps/via/keymap.c b/keyboards/bastardkb/dilemma/3x5_3/keymaps/via/keymap.c index be921e5f1c5..5c49e6d391f 100644 --- a/keyboards/bastardkb/dilemma/3x5_3/keymaps/via/keymap.c +++ b/keyboards/bastardkb/dilemma/3x5_3/keymaps/via/keymap.c @@ -195,6 +195,58 @@ layer_state_t layer_state_set_user(layer_state_t state) { # endif // DILEMMA_AUTO_SNIPING_ON_LAYER #endif // POINTING_DEVICE_ENABLE +#ifdef RGB_MATRIX_ENABLE +// Forward-declare this helper function since it is defined in rgb_matrix.c. +void rgb_matrix_update_pwm_buffers(void); + +// Layer state indicator +bool rgb_matrix_indicators_advanced_user(uint8_t led_min, uint8_t led_max) { + if (host_keyboard_led_state().caps_lock) { + for (int i = led_min; i <= led_max; i++) { + if (g_led_config.flags[i] & LED_FLAG_MODIFIER) { + rgb_matrix_set_color(i, RGB_RED); + } + } + } + + uint8_t layer = get_highest_layer(layer_state); + if (layer > 0) { + RGB rgb; + switch (get_highest_layer(layer_state)) { + case 1: + rgb = (RGB){RGB_BLUE}; + break; + case 2: + rgb = (RGB){RGB_CORAL}; + break; + case 3: + rgb = (RGB){RGB_GREEN}; + break; + case 4: + rgb = (RGB){RGB_YELLOW}; + break; + case 5: + rgb = (RGB){RGB_PINK}; + break; + case 6: + rgb = (RGB){RGB_MAGENTA}; + break; + case 7: + default: + rgb = (RGB){RGB_RED}; + break; + }; + + for (int i = led_min; i <= led_max; i++) { + if ( g_led_config.flags[i] & LED_FLAG_UNDERGLOW) { + rgb_matrix_set_color(i, rgb.r, rgb.g, rgb.b); + } + }; + } + return false; +}; +#endif // RGB_MATRIX_ENABLE + #ifdef ENCODER_MAP_ENABLE // clang-format off const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { @@ -206,4 +258,12 @@ const uint16_t PROGMEM encoder_map[][NUM_ENCODERS][2] = { [LAYER_SYMBOLS] = {ENCODER_CCW_CW(RGB_RMOD, RGB_MOD), ENCODER_CCW_CW(KC_LEFT, KC_RGHT)}, }; // clang-format on -#endif // ENCODER_MAP_ENABLE +#endif // ENCODER_MAP_ENABL + +void shutdown_user(void) { +#ifdef RGB_MATRIX_ENABLE + rgb_matrix_sethsv_noeeprom(HSV_RED); + rgb_matrix_update_pwm_buffers(); +#endif // RGB_MATRIX_ENABLE +} + diff --git a/keyboards/bastardkb/dilemma/3x5_3/keymaps/via/rules.mk b/keyboards/bastardkb/dilemma/3x5_3/keymaps/via/rules.mk index 715838ecc5d..f1adcab005e 100644 --- a/keyboards/bastardkb/dilemma/3x5_3/keymaps/via/rules.mk +++ b/keyboards/bastardkb/dilemma/3x5_3/keymaps/via/rules.mk @@ -1,2 +1,2 @@ -ENCODER_MAP_ENABLE = yes VIA_ENABLE = yes +ENCODER_MAP_ENABLE = yes diff --git a/keyboards/bastardkb/dilemma/dilemma.c b/keyboards/bastardkb/dilemma/dilemma.c index 2f75cbc0a0e..7c87fdcadd6 100644 --- a/keyboards/bastardkb/dilemma/dilemma.c +++ b/keyboards/bastardkb/dilemma/dilemma.c @@ -2,7 +2,6 @@ * Copyright 2020 Christopher Courtney (@drashna) * Copyright 2021 Quentin LEBASTARD * Copyright 2022 Charly Delay (@0xcharly) - * Copyright 2023 casuanoob (@casuanoob) * * This program is free software: you can redistribute it and/or modify * it under the terms of the GNU General Publicw License as published by