diff options
Diffstat (limited to 'src/keymaps/soispha')
-rw-r--r-- | src/keymaps/soispha/config.h | 44 | ||||
-rw-r--r-- | src/keymaps/soispha/keymap.c | 390 | ||||
-rw-r--r-- | src/keymaps/soispha/layout/keymap.h | 92 | ||||
-rw-r--r-- | src/keymaps/soispha/layout/layout.h | 21 | ||||
-rw-r--r-- | src/keymaps/soispha/macros.h | 51 | ||||
-rw-r--r-- | src/keymaps/soispha/rgb.c | 227 | ||||
-rw-r--r-- | src/keymaps/soispha/rules.mk | 31 |
7 files changed, 856 insertions, 0 deletions
diff --git a/src/keymaps/soispha/config.h b/src/keymaps/soispha/config.h new file mode 100644 index 0000000..2b1d36a --- /dev/null +++ b/src/keymaps/soispha/config.h @@ -0,0 +1,44 @@ +// LTeX: language=off + +/* + * Moonlander Layout + * + * Copyright (C) 2024 Benedikt Peetz <benedikt.peetz@b-peetz.de> + * SPDX-License-Identifier: AGPL-3.0-or-later + * + * This file is part of Moonlander Layout. + * + * You should have received a copy of the License along with this program. + * If not, see <https://www.gnu.org/licenses/agpl.txt>. + */ + +/* + Set any config.h overrides for your specific keymap here. + See config.h options at + https://docs.qmk.fm/#/config_options?id=the-configh-file +*/ + +#define DEBOUNCE 8 + +#define USB_SUSPEND_WAKEUP_DELAY 0 +#define LAYER_STATE_16BIT + +#define UNICODE_SELECTED_MODES UNICODE_MODE_LINUX + +#define MOUSEKEY_DELAY 0 +#define MOUSEKEY_INTERVAL 20 +#define MOUSEKEY_MAX_SPEED 7 +#define MOUSEKEY_TIME_TO_MAX 60 +#define MOUSEKEY_WHEEL_DELAY 400 +#define MOUSEKEY_WHEEL_INTERVAL MOUSEKEY_INTERVAL +#define MOUSEKEY_WHEEL_MAX_SPEED MOUSEKEY_MAX_SPEED +#define MOUSEKEY_WHEEL_TIME_TO_MAX MOUSEKEY_TIME_TO_MAX + +// maybe? +// #define MOUSEKEY_INTERVAL 20 +// #define MOUSEKEY_DELAY 0 +// #define MOUSEKEY_TIME_TO_MAX 60 +// #define MOUSEKEY_MAX_SPEED 7 +// #define MOUSEKEY_WHEEL_DELAY 0 + +#define RGB_MATRIX_STARTUP_SPD 60 diff --git a/src/keymaps/soispha/keymap.c b/src/keymaps/soispha/keymap.c new file mode 100644 index 0000000..9391212 --- /dev/null +++ b/src/keymaps/soispha/keymap.c @@ -0,0 +1,390 @@ +/* + * Moonlander Layout + * + * Copyright (C) 2024 Benedikt Peetz <benedikt.peetz@b-peetz.de> + * SPDX-License-Identifier: AGPL-3.0-or-later + * + * This file is part of Moonlander Layout. + * + * You should have received a copy of the License along with this program. + * If not, see <https://www.gnu.org/licenses/agpl.txt>. + */ + +#include "layout/layout.h" +#include "macros.h" +#include "version.h" + +bool process_record_user(uint16_t keycode, keyrecord_t *record) { + switch (keycode) { + case VERSION_NUMBER: + if (record->event.pressed) { + SEND_STRING(QMK_KEYBOARD "/" QMK_KEYMAP " @ " QMK_VERSION + " (rev: " QMK_GIT_HASH ")"); + } + break; + case ST_MACRO_0: + if (record->event.pressed) { + SEND_STRING(SS_TAP(X_CAPS) SS_DELAY(100) SS_LSFT(SS_TAP(X_QUOTE)) + SS_DELAY(100) SS_TAP(X_A)); + } + break; + case ST_MACRO_1: + if (record->event.pressed) { + SEND_STRING(SS_TAP(X_CAPS) SS_DELAY(100) SS_LSFT(SS_TAP(X_QUOTE)) + SS_DELAY(100) SS_TAP(X_O)); + } + break; + case ST_MACRO_2: + if (record->event.pressed) { + SEND_STRING(SS_TAP(X_CAPS) SS_DELAY(100) SS_LSFT(SS_TAP(X_QUOTE)) + SS_DELAY(100) SS_TAP(X_U)); + } + break; + case ST_MACRO_3: + if (record->event.pressed) { + SEND_STRING(SS_TAP(X_CAPS) SS_DELAY(100) SS_LSFT(SS_TAP(X_QUOTE)) + SS_DELAY(100) SS_LSFT(SS_TAP(X_U))); + } + break; + case ST_MACRO_4: + if (record->event.pressed) { + SEND_STRING(SS_TAP(X_CAPS) SS_DELAY(100) SS_LSFT(SS_TAP(X_QUOTE)) + SS_DELAY(100) SS_LSFT(SS_TAP(X_O))); + } + break; + case ST_MACRO_5: + if (record->event.pressed) { + SEND_STRING(SS_TAP(X_CAPS) SS_DELAY(100) SS_LSFT(SS_TAP(X_QUOTE)) + SS_DELAY(100) SS_LSFT(SS_TAP(X_A))); + } + break; + case ST_MACRO_6: + if (record->event.pressed) { + SEND_STRING(SS_TAP(X_CAPS) SS_DELAY(100) SS_TAP(X_O) SS_DELAY(100) + SS_TAP(X_A)); + } + break; + case ST_MACRO_7: + if (record->event.pressed) { + SEND_STRING(SS_TAP(X_CAPS) SS_DELAY(100) SS_TAP(X_O) SS_DELAY(100) + SS_LSFT(SS_TAP(X_A))); + } + break; + + case RGB_SLD: + if (record->event.pressed) { + rgblight_mode(1); + } + return false; + } + return true; +} + +typedef struct { + bool is_press_action; + uint8_t step; +} tap; + +enum { + SINGLE_TAP = 1, + SINGLE_HOLD, + DOUBLE_TAP, + DOUBLE_HOLD, + DOUBLE_SINGLE_TAP, + MORE_TAPS +}; + +static tap dance_state[5]; + +uint8_t dance_step(tap_dance_state_t *state); + +uint8_t dance_step(tap_dance_state_t *state) { + if (state->count == 1) { + if (state->interrupted || !state->pressed) + return SINGLE_TAP; + else + return SINGLE_HOLD; + } else if (state->count == 2) { + if (state->interrupted) + return DOUBLE_SINGLE_TAP; + else if (state->pressed) + return DOUBLE_HOLD; + else + return DOUBLE_TAP; + } + return MORE_TAPS; +} + +void on_dance_0(tap_dance_state_t *state, void *user_data); +void dance_0_finished(tap_dance_state_t *state, void *user_data); +void dance_0_reset(tap_dance_state_t *state, void *user_data); + +void on_dance_0(tap_dance_state_t *state, void *user_data) { + if (state->count == 3) { + tap_code16(KC_SCLN); + tap_code16(KC_SCLN); + tap_code16(KC_SCLN); + } + if (state->count > 3) { + tap_code16(KC_SCLN); + } +} + +void dance_0_finished(tap_dance_state_t *state, void *user_data) { + dance_state[0].step = dance_step(state); + switch (dance_state[0].step) { + case SINGLE_TAP: + register_code16(KC_SCLN); + break; + case SINGLE_HOLD: + register_code16(KC_COLN); + break; + case DOUBLE_TAP: + register_code16(KC_SCLN); + register_code16(KC_SCLN); + break; + case DOUBLE_SINGLE_TAP: + tap_code16(KC_SCLN); + register_code16(KC_SCLN); + } +} + +void dance_0_reset(tap_dance_state_t *state, void *user_data) { + wait_ms(10); + switch (dance_state[0].step) { + case SINGLE_TAP: + unregister_code16(KC_SCLN); + break; + case SINGLE_HOLD: + unregister_code16(KC_COLN); + break; + case DOUBLE_TAP: + unregister_code16(KC_SCLN); + break; + case DOUBLE_SINGLE_TAP: + unregister_code16(KC_SCLN); + break; + } + dance_state[0].step = 0; +} +void on_dance_1(tap_dance_state_t *state, void *user_data); +void dance_1_finished(tap_dance_state_t *state, void *user_data); +void dance_1_reset(tap_dance_state_t *state, void *user_data); + +void on_dance_1(tap_dance_state_t *state, void *user_data) { + if (state->count == 3) { + tap_code16(KC_SLASH); + tap_code16(KC_SLASH); + tap_code16(KC_SLASH); + } + if (state->count > 3) { + tap_code16(KC_SLASH); + } +} + +void dance_1_finished(tap_dance_state_t *state, void *user_data) { + dance_state[1].step = dance_step(state); + switch (dance_state[1].step) { + case SINGLE_TAP: + register_code16(KC_SLASH); + break; + case SINGLE_HOLD: + register_code16(KC_BSLS); + break; + case DOUBLE_TAP: + register_code16(KC_SLASH); + register_code16(KC_SLASH); + break; + case DOUBLE_SINGLE_TAP: + tap_code16(KC_SLASH); + register_code16(KC_SLASH); + } +} + +void dance_1_reset(tap_dance_state_t *state, void *user_data) { + wait_ms(10); + switch (dance_state[1].step) { + case SINGLE_TAP: + unregister_code16(KC_SLASH); + break; + case SINGLE_HOLD: + unregister_code16(KC_BSLS); + break; + case DOUBLE_TAP: + unregister_code16(KC_SLASH); + break; + case DOUBLE_SINGLE_TAP: + unregister_code16(KC_SLASH); + break; + } + dance_state[1].step = 0; +} +void on_dance_2(tap_dance_state_t *state, void *user_data); +void dance_2_finished(tap_dance_state_t *state, void *user_data); +void dance_2_reset(tap_dance_state_t *state, void *user_data); + +void on_dance_2(tap_dance_state_t *state, void *user_data) { + if (state->count == 3) { + tap_code16(KC_MINUS); + tap_code16(KC_MINUS); + tap_code16(KC_MINUS); + } + if (state->count > 3) { + tap_code16(KC_MINUS); + } +} + +void dance_2_finished(tap_dance_state_t *state, void *user_data) { + dance_state[2].step = dance_step(state); + switch (dance_state[2].step) { + case SINGLE_TAP: + register_code16(KC_MINUS); + break; + case SINGLE_HOLD: + register_code16(KC_UNDS); + break; + case DOUBLE_TAP: + register_code16(KC_MINUS); + register_code16(KC_MINUS); + break; + case DOUBLE_SINGLE_TAP: + tap_code16(KC_MINUS); + register_code16(KC_MINUS); + } +} + +void dance_2_reset(tap_dance_state_t *state, void *user_data) { + wait_ms(10); + switch (dance_state[2].step) { + case SINGLE_TAP: + unregister_code16(KC_MINUS); + break; + case SINGLE_HOLD: + unregister_code16(KC_UNDS); + break; + case DOUBLE_TAP: + unregister_code16(KC_MINUS); + break; + case DOUBLE_SINGLE_TAP: + unregister_code16(KC_MINUS); + break; + } + dance_state[2].step = 0; +} +void on_dance_3(tap_dance_state_t *state, void *user_data); +void dance_3_finished(tap_dance_state_t *state, void *user_data); +void dance_3_reset(tap_dance_state_t *state, void *user_data); + +void on_dance_3(tap_dance_state_t *state, void *user_data) { + if (state->count == 3) { + tap_code16(KC_QUOTE); + tap_code16(KC_QUOTE); + tap_code16(KC_QUOTE); + } + if (state->count > 3) { + tap_code16(KC_QUOTE); + } +} + +void dance_3_finished(tap_dance_state_t *state, void *user_data) { + dance_state[3].step = dance_step(state); + switch (dance_state[3].step) { + case SINGLE_TAP: + register_code16(KC_QUOTE); + break; + case SINGLE_HOLD: + register_code16(KC_DQUO); + break; + case DOUBLE_TAP: + register_code16(KC_QUOTE); + register_code16(KC_QUOTE); + break; + case DOUBLE_SINGLE_TAP: + tap_code16(KC_QUOTE); + register_code16(KC_QUOTE); + } +} + +void dance_3_reset(tap_dance_state_t *state, void *user_data) { + wait_ms(10); + switch (dance_state[3].step) { + case SINGLE_TAP: + unregister_code16(KC_QUOTE); + break; + case SINGLE_HOLD: + unregister_code16(KC_DQUO); + break; + case DOUBLE_TAP: + unregister_code16(KC_QUOTE); + break; + case DOUBLE_SINGLE_TAP: + unregister_code16(KC_QUOTE); + break; + } + dance_state[3].step = 0; +} +void on_dance_4(tap_dance_state_t *state, void *user_data); +void dance_4_finished(tap_dance_state_t *state, void *user_data); +void dance_4_reset(tap_dance_state_t *state, void *user_data); + +void on_dance_4(tap_dance_state_t *state, void *user_data) { + if (state->count == 3) { + tap_code16(KC_EQUAL); + tap_code16(KC_EQUAL); + tap_code16(KC_EQUAL); + } + if (state->count > 3) { + tap_code16(KC_EQUAL); + } +} + +void dance_4_finished(tap_dance_state_t *state, void *user_data) { + dance_state[4].step = dance_step(state); + switch (dance_state[4].step) { + case SINGLE_TAP: + register_code16(KC_EQUAL); + break; + case SINGLE_HOLD: + register_code16(KC_PLUS); + break; + case DOUBLE_TAP: + register_code16(KC_EQUAL); + register_code16(KC_EQUAL); + break; + case DOUBLE_SINGLE_TAP: + tap_code16(KC_EQUAL); + register_code16(KC_EQUAL); + } +} + +void dance_4_reset(tap_dance_state_t *state, void *user_data) { + wait_ms(10); + switch (dance_state[4].step) { + case SINGLE_TAP: + unregister_code16(KC_EQUAL); + break; + case SINGLE_HOLD: + unregister_code16(KC_PLUS); + break; + case DOUBLE_TAP: + unregister_code16(KC_EQUAL); + break; + case DOUBLE_SINGLE_TAP: + unregister_code16(KC_EQUAL); + break; + } + dance_state[4].step = 0; +} + +tap_dance_action_t tap_dance_actions[] = { + [DANCE_0] = ACTION_TAP_DANCE_FN_ADVANCED(on_dance_0, dance_0_finished, + dance_0_reset), + [DANCE_1] = ACTION_TAP_DANCE_FN_ADVANCED(on_dance_1, dance_1_finished, + dance_1_reset), + [DANCE_2] = ACTION_TAP_DANCE_FN_ADVANCED(on_dance_2, dance_2_finished, + dance_2_reset), + [DANCE_3] = ACTION_TAP_DANCE_FN_ADVANCED(on_dance_3, dance_3_finished, + dance_3_reset), + [DANCE_4] = ACTION_TAP_DANCE_FN_ADVANCED(on_dance_4, dance_4_finished, + dance_4_reset), +}; diff --git a/src/keymaps/soispha/layout/keymap.h b/src/keymaps/soispha/layout/keymap.h new file mode 100644 index 0000000..d4b183a --- /dev/null +++ b/src/keymaps/soispha/layout/keymap.h @@ -0,0 +1,92 @@ +const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { + [0] = LAYOUT_moonlander( // Dvorak + KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, QK_BOOT, QK_BOOT, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, VERSION_NUMBER, + TG(5), KC_QUOTE, KC_COMMA, LT(9,KC_DOT), KC_P, KC_Y, KK_TP, KK_TP, KC_F, KC_G, LT(9,KC_C), KC_R, KC_L, TG(5), + MO(7), KC_A, KC_O, KC_E, KC_U, KC_I, MO(8), MO(8), KC_D, KC_H, KC_T, KC_N, KC_S, MO(7), + KC_LEFT_SHIFT, KC_SCLN, KC_Q, KC_J, KC_K, KC_X, KC_B, KC_M, KC_W, KC_V, KC_Z, KC_RIGHT_SHIFT, + KK_TP, KK_TP, KK_TP, KC_LEFT, KC_RIGHT, HYPR(KC_T), HYPR(KC_K), KC_UP, KC_DOWN, KK_TP, KK_TP, KC_RIGHT_SHIFT, + MO(3), MO(4), MO(6), KK_TP, MO(1), MO(2) + + ), + [1] = LAYOUT_moonlander( // River + KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, RV_SP_NHK, RV_SP_NRG_BR, RV_SP_KPSS, RV_SP_SGNL, KK_TP, KK_TP, + KK_TP, RV_SC_SHOT, RV_PAUSE, RV_TG_MSC, RV_RUN, KK_TP, KK_TP, KK_TP, RV_TG_FLOAT, RV_TG_FL_SC, RV_ZOOM_VW, KK_TP, RV_EXIT, KK_TP, + KK_TP, KK_TP, KK_TP, RV_MV_VW_PRVS_TG, RV_MV_PRVS_TG, RV_MV_OT_NXT, KK_TP, KK_TP, RV_VW_CLSE, RV_VW_NXT, RV_SWP_NXT, RV_SWP_PRVS, RV_VW_PRVS, KK_TP, + KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, RV_SEND_OUT, KK_TP, KK_TP, KK_TP, KK_TP, + KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, + KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP + + ), + [2] = LAYOUT_moonlander( // Modifier + KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, + KK_TP, OSM(MOD_RSFT), OSM(MOD_RGUI), OSM(MOD_RCTL), OSM(MOD_RALT), KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, + KK_TP, OSM(MOD_LSFT), OSM(MOD_LGUI), OSM(MOD_LCTL), OSM(MOD_LALT), KK_TP, KK_TP, KK_TP, KC_TAB, KC_SPACE, KC_BSPC, KC_ENTER, KC_ESCAPE, KK_TP, + KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, + KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, + KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP + + ), + [3] = LAYOUT_moonlander( // Symbols + KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, + KK_TP, KC_GRAVE, KC_EXLM, KC_DLR, KC_PERC, CW_TOGG, KK_TP, KK_TP, KC_AT, KC_HASH, KC_AMPR, KC_ASTR, KC_QUES, KK_TP, + KK_TP, KC_LABK, KC_LBRC, KC_LPRN, KC_LCBR, TD(DANCE_0), KK_TP, KK_TP, KC_TILD, TD(DANCE_1), TD(DANCE_2), TD(DANCE_3), KC_PLUS, KK_TP, + KK_TP, KC_RABK, KC_RBRC, KC_RPRN, KC_RCBR, KK_TP, KC_CIRC, KC_BSLS, KC_COMMA, TD(DANCE_4), KC_PIPE, KK_TP, + KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, + KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP + + ), + [4] = LAYOUT_moonlander( // Numbers + KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, + KK_TP, KC_F1, KC_F2, KC_F3, KC_F4, KC_F5, KK_TP, KK_TP, KK_TP, KC_1, KC_2, KC_3, KK_TP, KK_TP, + KK_TP, KC_F6, KC_F7, KC_F8, KC_F9, KC_F10, KK_TP, KK_TP, KC_0, KC_4, KC_5, KC_6, KK_TP, KK_TP, + KK_TP, KC_F11, KC_F12, KC_F13, KC_F14, KC_F15, KK_TP, KC_7, KC_8, KC_9, KK_TP, KK_TP, + KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, + KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP + + ), + [5] = LAYOUT_moonlander( // Media + KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, QK_BOOT, + KK_TP, KK_TP, KC_MS_BTN2, KC_MS_BTN3, KC_MS_BTN1, KK_TP, KK_TP, KK_TP, KK_TP, KC_MS_BTN1, KC_MS_BTN3, KC_MS_BTN2, KK_TP, KK_TP, + KK_TP, KC_MS_WH_UP, QK_MOUSE_WHEEL_UP, QK_MOUSE_WHEEL_DOWN, KC_MS_WH_LEFT, KK_TP, KK_TP, KK_TP, KK_TP, KC_MS_LEFT, KC_MS_DOWN, KC_MS_UP, KC_MS_RIGHT, KK_TP, + KK_TP, LCTL(LSFT(KC_TAB)), LALT(LCTL(KC_R)), LCTL(KC_T), LCTL(KC_TAB), KK_TP, KK_TP, KC_WWW_BACK, KK_TP, KC_WWW_HOME, KC_WWW_FORWARD, KK_TP, + KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, + KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP + + ), + [6] = LAYOUT_moonlander( // River Tag Movement + KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, + KK_TP, KK_TP, MEH(KC_3), MEH(KC_2), MEH(KC_1), KK_TP, KK_TP, KK_TP, KK_TP, HYPR(KC_1), HYPR(KC_2), HYPR(KC_3), KK_TP, KK_TP, + KK_TP, KK_TP, MEH(KC_6), MEH(KC_5), MEH(KC_4), MEH(KC_0), KK_TP, KK_TP, HYPR(KC_0), HYPR(KC_4), HYPR(KC_5), HYPR(KC_6), KK_TP, KK_TP, + KK_TP, KK_TP, MEH(KC_9), MEH(KC_8), MEH(KC_7), KK_TP, KK_TP, HYPR(KC_7), HYPR(KC_8), HYPR(KC_9), KK_TP, KK_TP, + KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, + KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP + + ), + [7] = LAYOUT_moonlander( // German characters + KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, + KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, + KK_TP, ST_MACRO_0, ST_MACRO_1, KK_TP, ST_MACRO_2, KK_TP, KK_TP, KK_TP, KK_TP, ST_MACRO_3, KK_TP, ST_MACRO_4, ST_MACRO_5, KK_TP, + KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, + KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, + KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP + + ), + [8] = LAYOUT_moonlander( // Swedish characters + KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, + KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, + KK_TP, ST_MACRO_6, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, ST_MACRO_7, KK_TP, + KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, + KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, + KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP + + ), + [9] = LAYOUT_moonlander( // Special characters + KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, + KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, + KK_TP, UC(0x201C), KK_TP, KK_TP, UC(0x201D), KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, + KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, + KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, + KK_TP, KK_TP, KK_TP, KK_TP, KK_TP, KK_TP + + ), +}; diff --git a/src/keymaps/soispha/layout/layout.h b/src/keymaps/soispha/layout/layout.h new file mode 100644 index 0000000..4acb7f5 --- /dev/null +++ b/src/keymaps/soispha/layout/layout.h @@ -0,0 +1,21 @@ +/* + * Moonlander Layout + * + * Copyright (C) 2024 Benedikt Peetz <benedikt.peetz@b-peetz.de> + * SPDX-License-Identifier: AGPL-3.0-or-later + * + * This file is part of Moonlander Layout. + * + * You should have received a copy of the License along with this program. + * If not, see <https://www.gnu.org/licenses/agpl.txt>. + */ + +#pragma once +#include QMK_KEYBOARD_H +#include "../macros.h" + +#define KK_TP KC_TRANSPARENT + +#include "keymap.h" + +// vim: cursorcolumn nowrap diff --git a/src/keymaps/soispha/macros.h b/src/keymaps/soispha/macros.h new file mode 100644 index 0000000..e337830 --- /dev/null +++ b/src/keymaps/soispha/macros.h @@ -0,0 +1,51 @@ +#pragma once + +#include QMK_KEYBOARD_H + +#define ML_SAFE_RANGE SAFE_RANGE + +enum custom_keycodes { + RGB_SLD = ML_SAFE_RANGE, + ST_MACRO_0, + ST_MACRO_1, + ST_MACRO_2, + ST_MACRO_3, + ST_MACRO_4, + ST_MACRO_5, + ST_MACRO_6, + ST_MACRO_7, + VERSION_NUMBER, +}; + +enum tap_dance_codes { + DANCE_0, + DANCE_1, + DANCE_2, + DANCE_3, + DANCE_4, +}; + +// river_mappings { +#define RV_SC_SHOT HYPR(KC_L) +#define RV_PAUSE HYPR(KC_M) +#define RV_TG_MSC HYPR(KC_N) +#define RV_RUN HYPR(KC_O) +#define RV_MV_VW_PRVS_TG HYPR(KC_W) +#define RV_MV_PRVS_TG HYPR(KC_V) +#define RV_MV_OT_NXT HYPR(KC_U) + +#define RV_SP_NHK HYPR(KC_R) +#define RV_SP_NRG_BR HYPR(KC_P) +#define RV_SP_KPSS HYPR(KC_Q) +#define RV_SP_SGNL HYPR(KC_S) + +#define RV_TG_FLOAT HYPR(KC_I) +#define RV_TG_FL_SC HYPR(KC_H) +#define RV_ZOOM_VW HYPR(KC_G) +#define RV_EXIT HYPR(KC_A) +#define RV_VW_CLSE HYPR(KC_B) +#define RV_VW_NXT HYPR(KC_D) +#define RV_SWP_NXT HYPR(KC_F) +#define RV_SWP_PRVS HYPR(KC_E) +#define RV_VW_PRVS HYPR(KC_C) +#define RV_SEND_OUT HYPR(KC_J) diff --git a/src/keymaps/soispha/rgb.c b/src/keymaps/soispha/rgb.c new file mode 100644 index 0000000..183296e --- /dev/null +++ b/src/keymaps/soispha/rgb.c @@ -0,0 +1,227 @@ +#include QMK_KEYBOARD_H +#define MOON_LED_LEVEL LED_LEVEL + +extern rgb_config_t rgb_matrix_config; + +void keyboard_post_init_user(void) { rgb_matrix_enable(); } + +// clang-format off +const uint8_t PROGMEM ledmap[][RGB_MATRIX_LED_COUNT][3] = { + [0] = {{0, 255, 255}, {86, 255, 128}, {86, 255, 128}, {172, 255, 255}, + {215, 255, 128}, {0, 255, 255}, {27, 255, 255}, {86, 255, 128}, + {172, 255, 255}, {215, 255, 128}, {0, 255, 255}, {27, 255, 255}, + {86, 255, 128}, {172, 255, 255}, {215, 255, 128}, {0, 255, 255}, + {27, 255, 255}, {86, 255, 128}, {172, 255, 255}, {215, 255, 128}, + {0, 255, 255}, {27, 255, 255}, {43, 255, 255}, {172, 255, 255}, + {215, 255, 128}, {0, 255, 255}, {27, 255, 255}, {86, 255, 128}, + {172, 255, 255}, {0, 255, 255}, {27, 255, 255}, {27, 255, 255}, + {0, 245, 245}, {0, 245, 245}, {0, 245, 245}, {0, 0, 0}, + {0, 255, 255}, {86, 255, 128}, {86, 255, 128}, {172, 255, 255}, + {215, 255, 128}, {0, 255, 255}, {27, 255, 255}, {86, 255, 128}, + {172, 255, 255}, {215, 255, 128}, {0, 255, 255}, {27, 255, 255}, + {86, 255, 128}, {172, 255, 255}, {215, 255, 128}, {0, 255, 255}, + {27, 255, 255}, {86, 255, 128}, {172, 255, 255}, {215, 255, 128}, + {0, 255, 255}, {27, 255, 255}, {43, 255, 255}, {172, 255, 255}, + {215, 255, 128}, {0, 255, 255}, {27, 255, 255}, {86, 255, 128}, + {172, 255, 255}, {0, 255, 255}, {27, 255, 255}, {27, 255, 255}, + {0, 245, 245}, {0, 245, 245}, {0, 245, 245}, {0, 0, 0}}, + + [1] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 245, 245}, {0, 245, 245}, {0, 245, 245}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 245, 245}, {131, 255, 255}, {0, 245, 245}, {0, 0, 0}}, + + [2] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 245, 245}, {0, 245, 245}, {0, 245, 245}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {131, 255, 255}, {0, 245, 245}, {0, 245, 245}, {0, 0, 0}}, + + [3] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {131, 255, 255}, {0, 245, 245}, {0, 245, 245}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 245, 245}, {0, 245, 245}, {0, 245, 245}, {0, 0, 0}}, + + [4] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 245, 245}, {131, 255, 255}, {0, 245, 245}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 245, 245}, {0, 245, 245}, {0, 245, 245}, {0, 0, 0}}, + + [5] = {{0, 0, 0}, {131, 255, 255}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 245, 245}, {0, 245, 245}, {0, 245, 245}, {0, 245, 245}, + {0, 0, 0}, {131, 255, 255}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 245, 245}, {0, 245, 245}, {0, 245, 245}, {0, 245, 245}}, + + [6] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 245, 245}, {0, 245, 245}, {131, 255, 255}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 245, 245}, {0, 245, 245}, {0, 245, 245}, {0, 0, 0}}, + + [7] = {{0, 0, 0}, {0, 0, 0}, {131, 255, 255}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {215, 255, 128}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {215, 255, 128}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {215, 255, 128}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {131, 255, 255}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {215, 255, 128}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {215, 255, 128}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {215, 255, 128}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}}, + + [8] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {215, 255, 128}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {131, 255, 255}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {215, 255, 128}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {131, 255, 255}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}}, + + [9] = {{0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {131, 255, 255}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {131, 255, 255}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, {0, 0, 0}, + {0, 0, 0}, {0, 0, 0}}, +}; +// clang-format on + +void set_layer_color(int layer) { + for (int i = 0; i < RGB_MATRIX_LED_COUNT; i++) { + HSV hsv = { + .h = pgm_read_byte(&ledmap[layer][i][0]), + .s = pgm_read_byte(&ledmap[layer][i][1]), + .v = pgm_read_byte(&ledmap[layer][i][2]), + }; + if (!hsv.h && !hsv.s && !hsv.v) { + rgb_matrix_set_color(i, 0, 0, 0); + } else { + RGB rgb = hsv_to_rgb(hsv); + float f = (float)rgb_matrix_config.hsv.v / UINT8_MAX; + rgb_matrix_set_color(i, f * rgb.r, f * rgb.g, f * rgb.b); + } + } +} + +bool rgb_matrix_indicators_user(void) { + if (keyboard_config.disable_layer_led) { + return false; + } + + int layer = biton32(layer_state); + if (layer <= 9) { + set_layer_color(layer); + } else { + if (rgb_matrix_get_flags() == LED_FLAG_NONE) { + rgb_matrix_set_color_all(0, 0, 0); + } + } + return true; +} diff --git a/src/keymaps/soispha/rules.mk b/src/keymaps/soispha/rules.mk new file mode 100644 index 0000000..c04c2d7 --- /dev/null +++ b/src/keymaps/soispha/rules.mk @@ -0,0 +1,31 @@ +# Moonlander Layout +# +# Copyright (C) 2024 Benedikt Peetz <benedikt.peetz@b-peetz.de> +# SPDX-License-Identifier: AGPL-3.0-or-later +# +# This file is part of Moonlander Layout. +# +# You should have received a copy of the License along with this program. +# If not, see <https://www.gnu.org/licenses/agpl.txt>. + +# Set any rules.mk overrides for your specific keymap here. +# See rules at https://docs.qmk.fm/#/config_options?id=the-rulesmk-file +AUDIO_ENABLE = yes +BOOTMAGIC_ENABLE = yes +CAPS_WORD_ENABLE = yes +COMMAND_ENABLE = no +CONSOLE_ENABLE = no +DEFERRED_EXEC_ENABLE = yes +EXTRAKEY_ENABLE = yes +MOUSEKEY_ENABLE = yes +NKRO_ENABLE = yes +RGB_MATRIX_ENABLE = yes +SEND_STRING_ENABLE = yes +SPACE_CADET_ENABLE = no +SWAP_HANDS_ENABLE = yes +TAP_DANCE_ENABLE = yes + +UNICODE_COMMON = yes +UNICODE_ENABLE = yes + +SRC += rgb.c |