From 84d6be3da64f5c5bdd7eb0e550c28609754f4b28 Mon Sep 17 00:00:00 2001 From: Mark Date: Mon, 7 Feb 2022 20:15:35 -0800 Subject: [PATCH] Improved russian symbol layer logic --- keymaps/default/keymap.c | 13 ++++------- keymaps/default/layers.h | 1 - keymaps/default/layers/russian_symbols.h | 29 ------------------------ 3 files changed, 5 insertions(+), 38 deletions(-) delete mode 100644 keymaps/default/layers/russian_symbols.h diff --git a/keymaps/default/keymap.c b/keymaps/default/keymap.c index abc8db7..d9ad147 100644 --- a/keymaps/default/keymap.c +++ b/keymaps/default/keymap.c @@ -33,8 +33,7 @@ enum layer_indices { LAYER_NAVIGATE_IDX, LAYER_DESKTOP_IDX, LAYER_KEYBOARD_IDX, - LAYER_RUSSIAN_IDX, - LAYER_RUSSIAN_SYMBOLS_IDX, + LAYER_RUSSIAN_IDX }; const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [LAYER_MAIN_IDX] = LAYER_MAIN, @@ -46,8 +45,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { [LAYER_NAVIGATE_IDX] = LAYER_NAVIGATE, [LAYER_DESKTOP_IDX] = LAYER_DESKTOP, [LAYER_KEYBOARD_IDX] = LAYER_KEYBOARD, - [LAYER_RUSSIAN_IDX] = LAYER_RUSSIAN, - [LAYER_RUSSIAN_SYMBOLS_IDX] = LAYER_RUSSIAN_SYMBOLS, + [LAYER_RUSSIAN_IDX] = LAYER_RUSSIAN }; const uint8_t PROGMEM ledmap[][DRIVER_LED_TOTAL][3] = { [LAYER_COLEMAK_IDX] = LAYER_COLEMAK_LEDS, @@ -57,8 +55,7 @@ const uint8_t PROGMEM ledmap[][DRIVER_LED_TOTAL][3] = { [LAYER_FKEYS_IDX] = LAYER_FKEYS_LEDS, [LAYER_NAVIGATE_IDX] = LAYER_NAVIGATE_LEDS, [LAYER_DESKTOP_IDX] = LAYER_DESKTOP_LEDS, - [LAYER_RUSSIAN_IDX] = LAYER_RUSSIAN_LEDS, - [LAYER_RUSSIAN_SYMBOLS_IDX] = LAYER_RUSSIAN_SYMBOLS_LEDS + [LAYER_RUSSIAN_IDX] = LAYER_RUSSIAN_LEDS }; @@ -162,10 +159,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) { case RU_SYMBOL: if (record->event.pressed) { SEND_STRING(SS_LGUI(SS_LSFT(SS_LCTL(SS_TAP(X_0))))); - layer_move(10); + layer_on(LAYER_SYMBOLS_IDX); } else { SEND_STRING(SS_LGUI(SS_LSFT(SS_LCTL(SS_TAP(X_9))))); - layer_move(9); + layer_off(LAYER_SYMBOLS_IDX); } break; diff --git a/keymaps/default/layers.h b/keymaps/default/layers.h index 1ee47cf..5aba295 100644 --- a/keymaps/default/layers.h +++ b/keymaps/default/layers.h @@ -10,4 +10,3 @@ #include "layers/desktop.h" #include "layers/keyboard.h" #include "layers/russian.h" -#include "layers/russian_symbols.h" diff --git a/keymaps/default/layers/russian_symbols.h b/keymaps/default/layers/russian_symbols.h deleted file mode 100644 index e632aea..0000000 --- a/keymaps/default/layers/russian_symbols.h +++ /dev/null @@ -1,29 +0,0 @@ -#pragma once -#include "keymap.h" - -#define LAYER_RUSSIAN_SYMBOLS LAYOUT_ergodox(\ - KC_NO, KC_EXLM, KC_AT, KC_HASH, KC_DLR, KC_PERC, KC_NO,\ - KC_NO, KC_GRAVE, KC_LPRN, KC_RPRN, KC_QUES, KC_LCBR, KC_NO,\ - KC_NO, KC_TILD, KC_QUOTE, KC_COMMA, KC_DOT, KC_DQUO,\ - KC_NO, KC_NO, KC_LBRACKET, KC_RBRACKET, KC_EXLM, KC_RCBR, KC_NO,\ - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,\ -\ - KC_NO, KC_NO,\ - KC_NO,\ - KC_TRANSPARENT, KC_TRANSPARENT, KC_NO,\ -\ -\ - KC_NO, KC_CIRC, KC_AMPR, KC_ASTR, KC_NO, KC_NO, KC_NO,\ - KC_NO, KC_LABK, KC_RABK, KC_SLASH, KC_NO, KC_BSLASH, KC_NO,\ - KC_UNDS, KC_MINUS, KC_COLN, RU_SYMBOL, KC_PIPE, KC_NO,\ - KC_NO, KC_EQUAL, KC_PLUS, KC_SCOLON, KC_NO, KC_NO, KC_NO,\ - KC_NO, KC_NO, KC_NO, KC_NO, KC_NO,\ -\ - KC_NO, KC_NO,\ - KC_NO,\ - KC_NO, KC_NO, KC_TRANSPARENT\ -) - - -#define LAYER_RUSSIAN_SYMBOLS_LEDS \ -{ {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {85,203,158}, {85,203,158}, {134,255,213}, {0,0,0}, {134,255,213}, {134,255,213}, {85,203,158}, {243,222,234}, {10,225,255}, {134,255,213}, {85,203,158}, {85,203,158}, {243,222,234}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {134,255,213}, {243,222,234}, {134,255,213}, {134,255,213}, {10,225,255}, {243,222,234}, {243,222,234}, {243,222,234}, {243,222,234}, {10,225,255}, {134,255,213}, {243,222,234}, {134,255,213}, {134,255,213}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0}, {0,0,0} }