Improved russian symbol layer logic

master
Mark 2022-02-07 20:15:35 -08:00
parent 1459ed0258
commit 84d6be3da6
Signed by: Mark
GPG Key ID: AD62BB059C2AAEE4
3 changed files with 5 additions and 38 deletions

View File

@ -33,8 +33,7 @@ enum layer_indices {
LAYER_NAVIGATE_IDX, LAYER_NAVIGATE_IDX,
LAYER_DESKTOP_IDX, LAYER_DESKTOP_IDX,
LAYER_KEYBOARD_IDX, LAYER_KEYBOARD_IDX,
LAYER_RUSSIAN_IDX, LAYER_RUSSIAN_IDX
LAYER_RUSSIAN_SYMBOLS_IDX,
}; };
const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = { const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[LAYER_MAIN_IDX] = LAYER_MAIN, [LAYER_MAIN_IDX] = LAYER_MAIN,
@ -46,8 +45,7 @@ const uint16_t PROGMEM keymaps[][MATRIX_ROWS][MATRIX_COLS] = {
[LAYER_NAVIGATE_IDX] = LAYER_NAVIGATE, [LAYER_NAVIGATE_IDX] = LAYER_NAVIGATE,
[LAYER_DESKTOP_IDX] = LAYER_DESKTOP, [LAYER_DESKTOP_IDX] = LAYER_DESKTOP,
[LAYER_KEYBOARD_IDX] = LAYER_KEYBOARD, [LAYER_KEYBOARD_IDX] = LAYER_KEYBOARD,
[LAYER_RUSSIAN_IDX] = LAYER_RUSSIAN, [LAYER_RUSSIAN_IDX] = LAYER_RUSSIAN
[LAYER_RUSSIAN_SYMBOLS_IDX] = LAYER_RUSSIAN_SYMBOLS,
}; };
const uint8_t PROGMEM ledmap[][DRIVER_LED_TOTAL][3] = { const uint8_t PROGMEM ledmap[][DRIVER_LED_TOTAL][3] = {
[LAYER_COLEMAK_IDX] = LAYER_COLEMAK_LEDS, [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_FKEYS_IDX] = LAYER_FKEYS_LEDS,
[LAYER_NAVIGATE_IDX] = LAYER_NAVIGATE_LEDS, [LAYER_NAVIGATE_IDX] = LAYER_NAVIGATE_LEDS,
[LAYER_DESKTOP_IDX] = LAYER_DESKTOP_LEDS, [LAYER_DESKTOP_IDX] = LAYER_DESKTOP_LEDS,
[LAYER_RUSSIAN_IDX] = LAYER_RUSSIAN_LEDS, [LAYER_RUSSIAN_IDX] = LAYER_RUSSIAN_LEDS
[LAYER_RUSSIAN_SYMBOLS_IDX] = LAYER_RUSSIAN_SYMBOLS_LEDS
}; };
@ -162,10 +159,10 @@ bool process_record_user(uint16_t keycode, keyrecord_t *record) {
case RU_SYMBOL: case RU_SYMBOL:
if (record->event.pressed) { if (record->event.pressed) {
SEND_STRING(SS_LGUI(SS_LSFT(SS_LCTL(SS_TAP(X_0))))); SEND_STRING(SS_LGUI(SS_LSFT(SS_LCTL(SS_TAP(X_0)))));
layer_move(10); layer_on(LAYER_SYMBOLS_IDX);
} else { } else {
SEND_STRING(SS_LGUI(SS_LSFT(SS_LCTL(SS_TAP(X_9))))); SEND_STRING(SS_LGUI(SS_LSFT(SS_LCTL(SS_TAP(X_9)))));
layer_move(9); layer_off(LAYER_SYMBOLS_IDX);
} }
break; break;

View File

@ -10,4 +10,3 @@
#include "layers/desktop.h" #include "layers/desktop.h"
#include "layers/keyboard.h" #include "layers/keyboard.h"
#include "layers/russian.h" #include "layers/russian.h"
#include "layers/russian_symbols.h"

View File

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