From d0d170e6a04799d72279c1ebc56726a17d0564a6 Mon Sep 17 00:00:00 2001 From: Joel Challis Date: Sat, 12 Oct 2024 20:19:18 +0100 Subject: [PATCH] xiudi/xd002: Remove broken oversized `multilayer_rgb` keymap (#24480) --- .../xd002/keymaps/multilayer_rgb/config.h | 22 --- .../xd002/keymaps/multilayer_rgb/keymap.c | 174 ------------------ .../xd002/keymaps/multilayer_rgb/rgblite.h | 13 -- .../xd002/keymaps/multilayer_rgb/rules.mk | 2 - 4 files changed, 211 deletions(-) delete mode 100644 keyboards/xiudi/xd002/keymaps/multilayer_rgb/config.h delete mode 100644 keyboards/xiudi/xd002/keymaps/multilayer_rgb/keymap.c delete mode 100644 keyboards/xiudi/xd002/keymaps/multilayer_rgb/rgblite.h delete mode 100644 keyboards/xiudi/xd002/keymaps/multilayer_rgb/rules.mk diff --git a/keyboards/xiudi/xd002/keymaps/multilayer_rgb/config.h b/keyboards/xiudi/xd002/keymaps/multilayer_rgb/config.h deleted file mode 100644 index f478baf3b37e..000000000000 --- a/keyboards/xiudi/xd002/keymaps/multilayer_rgb/config.h +++ /dev/null @@ -1,22 +0,0 @@ -/* Copyright 2020 elmo-space - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ -#pragma once - -/*enable layers*/ -#undef NO_ACTION_LAYER - -/* increase tap duration (spotify doesn't like very short taps)*/ -#define TAP_CODE_DELAY 100 diff --git a/keyboards/xiudi/xd002/keymaps/multilayer_rgb/keymap.c b/keyboards/xiudi/xd002/keymaps/multilayer_rgb/keymap.c deleted file mode 100644 index d74678d76aae..000000000000 --- a/keyboards/xiudi/xd002/keymaps/multilayer_rgb/keymap.c +++ /dev/null @@ -1,174 +0,0 @@ -/* Copyright 2020 elmo-space - * - * This program is free software: you can redistribute it and/or modify - * it under the terms of the GNU General Public License as published by - * the Free Software Foundation, either version 2 of the License, or - * (at your option) any later version. - * - * This program is distributed in the hope that it will be useful, - * but WITHOUT ANY WARRANTY; without even the implied warranty of - * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the - * GNU General Public License for more details. - * - * You should have received a copy of the GNU General Public License - * along with this program. If not, see . - */ - -#include QMK_KEYBOARD_H -#include "rgblite.h" - -// Defines names for use in layer keycodes and the keymap -enum layer_names { - _BASE, - _FUNC, -}; - -// set your keycodes here -#define layer1_left KC_PAUS -#define layer1_right KC_MPLY -#define layer2_left KC_MPRV -#define layer2_right KC_MNXT - - -enum custom_keycodes { - LEFT1 = SAFE_RANGE, - RIGHT1, - LEFT2, - RIGHT2 -}; - -const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { - [_BASE] = LAYOUT( - LEFT1, RIGHT1 - ), - [_FUNC] = LAYOUT( - LEFT2, RIGHT2 - ) -}; - -static bool key1_down = false; -static bool key2_down = false; -static char layer_switched = 0; // this prevents the individual keys getting triggered after a layerchange - -bool process_record_user(uint16_t keycode, keyrecord_t *record) -{ - switch (keycode) - { - case LEFT1: - if (record->event.pressed) - { - if (key2_down) - { - layer_on(1); - layer_switched = 2; - return false; - break; - } - key1_down = true; - } - else { - if (layer_switched > 0) { - --layer_switched; - key1_down = false; - } - else { - tap_code(layer1_left); - key1_down = false; - } - } - return false; - break; - case RIGHT1: - if (record->event.pressed) - { - if (key1_down) - { - layer_on(1); - layer_switched = 2; - return false; - break; - } - key2_down = true; - } - else { - if (layer_switched > 0) { - --layer_switched; - key2_down = false; - } - else { - tap_code(layer1_right); - key2_down = false; - } - } - return false; - break; - case LEFT2: - if (record->event.pressed) - { - if (key2_down) - { - layer_off(1); - layer_switched = 2; - return false; - break; - } - key1_down = true; - } - else { - if (layer_switched > 0) { - --layer_switched; - key1_down = false; - } - else { - tap_code(layer2_left); - key1_down = false; - } - } - return false; - break; - case RIGHT2: - if (record->event.pressed) - { - if (key1_down) - { - layer_off(1); - layer_switched = 2; - return false; - break; - } - key2_down = true; - } - else { - if (layer_switched > 0) { - --layer_switched; - key2_down = false; - } - else { - tap_code(layer2_right); - key2_down = false; - } - } - return false; - break; - } - return true; -}; - -// layer colors -layer_state_t layer_state_set_user(layer_state_t state) { - switch (get_highest_layer(state)) { - case _FUNC: - rgblite_setrgb(RGB_RED); - break; - default: // for any other layers, or the default layer - rgblite_setrgb(RGB_GREEN); - break; - } - return state; -} - -// default color -void keyboard_post_init_user(void) { - rgblite_init(); - rgblite_setrgb(RGB_GREEN); -} diff --git a/keyboards/xiudi/xd002/keymaps/multilayer_rgb/rgblite.h b/keyboards/xiudi/xd002/keymaps/multilayer_rgb/rgblite.h deleted file mode 100644 index 0c88cd675249..000000000000 --- a/keyboards/xiudi/xd002/keymaps/multilayer_rgb/rgblite.h +++ /dev/null @@ -1,13 +0,0 @@ -#pragma once - -#include "ws2812.h" -#include "color.h" - -static inline void rgblite_init(void) { - ws2812_init(); -} - -static inline void rgblite_setrgb(uint8_t _r, uint8_t _g, uint8_t _b) { - rgb_t leds[RGBLIGHT_LED_COUNT] = {{.r = _r, .g = _g, .b = _b}, {.r = _r, .g = _g, .b = _b}}; - ws2812_setleds(leds, RGBLIGHT_LED_COUNT); -} diff --git a/keyboards/xiudi/xd002/keymaps/multilayer_rgb/rules.mk b/keyboards/xiudi/xd002/keymaps/multilayer_rgb/rules.mk deleted file mode 100644 index 07c75adb4707..000000000000 --- a/keyboards/xiudi/xd002/keymaps/multilayer_rgb/rules.mk +++ /dev/null @@ -1,2 +0,0 @@ -WS2812_DRIVER_REQUIRED = yes -EXTRAKEY_ENABLE = yes