Skip to content

Commit 013f3e3

Browse files
committed
fix: disable reset to default layout by timeout
1 parent 615e92a commit 013f3e3

6 files changed

Lines changed: 6 additions & 27 deletions

File tree

keyboards/splitkb/kyria/keymaps/meskill/config.h

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -33,7 +33,6 @@
3333
#ifdef RGBLIGHT_ENABLE
3434
// hardware settings
3535
#define RGBLIGHT_SLEEP
36-
#define RGB_DISABLE_WHEN_USB_SUSPENDED
3736
#define RGBLIGHT_TIMEOUT 600000
3837
// only underglow leds
3938
#undef RGBLIGHT_LED_COUNT

keyboards/splitkb/kyria/keymaps/meskill/features/lang_switch.c

Lines changed: 0 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -17,17 +17,10 @@
1717
#include "lang_switch.h"
1818
#include "debug.h"
1919

20-
static uint32_t timer = 0;
21-
22-
void reset_lang_switch_timer(void) {
23-
timer = timer_read32() + LANG_SWITCH_TIMEOUT;
24-
}
25-
2620
bool process_lang_switch(uint16_t keycode, keyrecord_t *record) {
2721
bool down = record->event.pressed;
2822
int mods = get_mods() | get_oneshot_mods();
2923

30-
reset_lang_switch_timer();
3124
uint16_t lang_layer_keycode = keymap_key_to_keycode(LANG_SWITCH_LAYER, record->event.key);
3225

3326
if (keycode != lang_layer_keycode || !mods || mods & MOD_MASK_SHIFT) {
@@ -48,12 +41,3 @@ bool process_lang_switch(uint16_t keycode, keyrecord_t *record) {
4841

4942
return true;
5043
}
51-
52-
void lang_switch_task(void) {
53-
if (timer_expired32(timer_read32(), timer)) {
54-
dprint("lang_switch_timer expired\n");
55-
layer_move(0);
56-
SWTC_EN();
57-
reset_lang_switch_timer();
58-
}
59-
}

keyboards/splitkb/kyria/keymaps/meskill/features/lang_switch.h

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -19,10 +19,8 @@
1919
#include QMK_KEYBOARD_H
2020
#include "layout.h"
2121

22-
#ifndef LANG_SWITCH_TIMEOUT
23-
# define LANG_SWITCH_TIMEOUT 600000 // default is 10 minutes
24-
#endif
25-
22+
// Processes the modifier keys for hotkeys when using the additional language layer
23+
// by converting the keycode to the keycode of the base layer.
24+
// That fixes the issues for some programs that separate hotkeys by language and not just by keycode.
25+
//
2626
bool process_lang_switch(uint16_t keycode, keyrecord_t *record);
27-
28-
void lang_switch_task(void);

keyboards/splitkb/kyria/keymaps/meskill/keymap.c

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ void keyboard_post_init_user(void) {
4141

4242
void matrix_scan_user(void) {
4343
lang_word_task();
44-
lang_switch_task();
4544
}
4645

4746
bool process_record_user(uint16_t keycode, keyrecord_t *record) {

keyboards/splitkb/kyria/keymaps/meskill/readme.md

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,5 @@
33
## Notable features
44

55
- **Two languages support** - support english and russian language as separate layers to make punctuation consistent between languages. Also, implement the language switch with language in the OS. Full support, currently will work only on Windows after installing [these keyboard layouts](https://github.com/meskill/settings-windows/tree/master/keyboard/layouts)
6-
- **Lang switch** - automatically switch from russian to english timeout
76
- **Lang word** - feature similar to CapsWord that allows to switch temporarily to another language to type single word and after typing switches back to the original language
87
- rgb lighting based on layers with visual markers

keyboards/splitkb/kyria/keymaps/meskill/rgb.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ enum {
2424
// and I need to overwrite ru layer with en so it should be higher in rgb sense
2525
RGB_RU = EN,
2626
RGB_EN = RU,
27-
RGB_DBG = MDA + 1,
27+
RGB_DBG = STP + 1,
2828
RGB_CWRD,
2929
RGB_RESET
3030
};
@@ -145,7 +145,7 @@ void layer_state_set_rgb(layer_state_t state) {
145145
}
146146

147147
static uint32_t rgb_timer;
148-
bool is_rgb_timeout = false;
148+
static bool is_rgb_timeout = false;
149149

150150
void refresh_rgb(void) {
151151
rgb_timer = timer_read32();

0 commit comments

Comments
 (0)